Submission #2241130
Source Code Expand
x=list(input()) stack=[] for i in range(len(x)): if x[i]=="S": stack.append(x[i]) elif x[i]=="T" and len(stack)==0: stack.append(x[i]) elif x[i]=="T" and stack[-1]=="T": stack.append(x[i]) elif x[i]=="T" and stack[-1]=="S": stack.pop() print(len(stack))
Submission Info
Submission Time | |
---|---|
Task | A - STring |
User | dexctercom |
Language | Python (3.4.3) |
Score | 300 |
Code Size | 312 Byte |
Status | AC |
Exec Time | 98 ms |
Memory | 6436 KB |
Judge Result
Set Name | Sample | Subtask1 | All | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | 100 / 100 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | example0, example1, example2 |
Subtask1 | example0, example1, example2, sub_corner0, sub_corner1, sub_corner2, sub_rand0, handmade0, handmade1 |
All | corner0, corner1, corner2, example0, example1, example2, handmade0, handmade1, maxrand0, sub_corner0, sub_corner1, sub_corner2, sub_rand0 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
corner0 | AC | 94 ms | 5668 KB |
corner1 | AC | 96 ms | 6436 KB |
corner2 | AC | 91 ms | 4836 KB |
example0 | AC | 17 ms | 3060 KB |
example1 | AC | 17 ms | 3064 KB |
example2 | AC | 17 ms | 3060 KB |
handmade0 | AC | 17 ms | 3060 KB |
handmade1 | AC | 17 ms | 3060 KB |
maxrand0 | AC | 98 ms | 4836 KB |
sub_corner0 | AC | 17 ms | 3060 KB |
sub_corner1 | AC | 17 ms | 3064 KB |
sub_corner2 | AC | 17 ms | 3064 KB |
sub_rand0 | AC | 17 ms | 3060 KB |