Submission #904314
Source Code Expand
#include <bits/stdc++.h> #define F first #define S second #define X real() #define Y imag() using namespace std; typedef long long ll; typedef long double ld; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); string s; cin>>s; string a; for (int i=0;i<(int)s.size();i++){ if ((int)a.size()>0&&a.back()=='S'&&s[i]=='T'){ a.pop_back(); } else{ a+=s[i]; } } cout<<a.size()<<endl; }
Submission Info
Submission Time | |
---|---|
Task | A - STring |
User | Laakeri |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 429 Byte |
Status | AC |
Exec Time | 58 ms |
Memory | 1356 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 | 58 ms | 1356 KB |
corner1 | AC | 5 ms | 916 KB |
corner2 | AC | 6 ms | 720 KB |
example0 | AC | 2 ms | 384 KB |
example1 | AC | 2 ms | 256 KB |
example2 | AC | 3 ms | 256 KB |
handmade0 | AC | 3 ms | 256 KB |
handmade1 | AC | 3 ms | 256 KB |
maxrand0 | AC | 6 ms | 720 KB |
sub_corner0 | AC | 3 ms | 256 KB |
sub_corner1 | AC | 3 ms | 256 KB |
sub_corner2 | AC | 3 ms | 256 KB |
sub_rand0 | AC | 2 ms | 256 KB |