Submission #907830


Source Code Expand

Copy
X = input()
stack = []
for l in X:
	if stack == []:
		stack.append(l)
	elif stack[-1] == "S" and l == "T":
		stack.pop()
	else:
		stack.append(l)
print(len(stack))

Submission Info

Submission Time
Task A - STring
User TAB
Language Python3 (3.4.3)
Score 300
Code Size 172 Byte
Status
Exec Time 79 ms
Memory 5096 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example0, example1, example2
Subtask1 200 / 200 example0, example1, example2, sub_corner0, sub_corner1, sub_corner2, sub_rand0, handmade0, handmade1
All 100 / 100 corner0, corner1, corner2, example0, example1, example2, handmade0, handmade1, maxrand0, sub_corner0, sub_corner1, sub_corner2, sub_rand0
Case Name Status Exec Time Memory
corner0 74 ms 4328 KB
corner1 79 ms 5096 KB
corner2 68 ms 3500 KB
example0 22 ms 3064 KB
example1 23 ms 3064 KB
example2 23 ms 3064 KB
handmade0 23 ms 3064 KB
handmade1 22 ms 3064 KB
maxrand0 74 ms 3500 KB
sub_corner0 23 ms 3064 KB
sub_corner1 23 ms 3064 KB
sub_corner2 23 ms 3064 KB
sub_rand0 23 ms 3064 KB