Submission #1498749
Source Code Expand
def ST_string_2(): x = str(raw_input()) stack = ['#'] for c in x: if c=="S": stack.append(c) else: if stack[-1]=="S": stack.pop() else: stack.append(c) print len(stack)-1 if __name__ == "__main__": ST_string_2()
Submission Info
Submission Time | |
---|---|
Task | A - STring |
User | zhuang |
Language | Python (2.7.6) |
Score | 300 |
Code Size | 252 Byte |
Status | AC |
Exec Time | 35 ms |
Memory | 4480 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 | 33 ms | 3712 KB |
corner1 | AC | 33 ms | 4480 KB |
corner2 | AC | 33 ms | 3072 KB |
example0 | AC | 10 ms | 2568 KB |
example1 | AC | 10 ms | 2568 KB |
example2 | AC | 10 ms | 2568 KB |
handmade0 | AC | 11 ms | 2568 KB |
handmade1 | AC | 10 ms | 2568 KB |
maxrand0 | AC | 35 ms | 2948 KB |
sub_corner0 | AC | 10 ms | 2568 KB |
sub_corner1 | AC | 10 ms | 2568 KB |
sub_corner2 | AC | 10 ms | 2568 KB |
sub_rand0 | AC | 10 ms | 2568 KB |