Submission #1368053
Source Code Expand
# -*- coding:utf-8 -*- X = list(input()) stack = [] for tmp in X: if tmp == 'T' and (len(stack) == 0 or stack[len(stack)-1] == 'T'): stack.append(tmp) elif tmp == 'T' and stack[len(stack)-1] == 'S': stack.pop() else: stack.append(tmp) print(len(stack))
Submission Info
Submission Time | |
---|---|
Task | A - STring |
User | Scotch |
Language | Python (3.4.3) |
Score | 300 |
Code Size | 298 Byte |
Status | AC |
Exec Time | 95 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 | 95 ms | 5668 KB |
corner1 | AC | 81 ms | 6436 KB |
corner2 | AC | 95 ms | 4840 KB |
example0 | AC | 17 ms | 3060 KB |
example1 | AC | 17 ms | 2940 KB |
example2 | AC | 17 ms | 2940 KB |
handmade0 | AC | 17 ms | 3064 KB |
handmade1 | AC | 18 ms | 2940 KB |
maxrand0 | AC | 95 ms | 4836 KB |
sub_corner0 | AC | 17 ms | 2940 KB |
sub_corner1 | AC | 18 ms | 3060 KB |
sub_corner2 | AC | 17 ms | 3060 KB |
sub_rand0 | AC | 17 ms | 3060 KB |