Submission #1354667
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++) #define REPO(i,n) for(int (i)=1; (i)<=(int)(n); (i)++) #define SZ(v) ((int)(v).size()) #define ALL(v) (v).begin(),(v).end() #define one first #define two second typedef long long ll; typedef pair<int, int> pi; const int INF = 0x3f2f1f0f; const ll LINF = 1ll * INF * INF; string S; int main() { cin >> S; while(true) { bool change = false; for(int i=0; i+1<SZ(S); i++) { if(S[i] == 'S' && S[i+1] == 'T') { change = true; S = S.substr(0, i) + S.substr(i+2, SZ(S) - i - 2); break; } } if(!change) break; } printf("%d\n", SZ(S)); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - STring |
User | kajebiii |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 703 Byte |
Status | TLE |
Exec Time | 1055 ms |
Memory | 1136 KB |
Judge Result
Set Name | Sample | Subtask1 | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | 0 / 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 | TLE | 1055 ms | 1020 KB |
corner1 | AC | 39 ms | 1136 KB |
corner2 | TLE | 1055 ms | 1020 KB |
example0 | AC | 1 ms | 256 KB |
example1 | AC | 1 ms | 256 KB |
example2 | AC | 1 ms | 256 KB |
handmade0 | AC | 1 ms | 256 KB |
handmade1 | AC | 1 ms | 256 KB |
maxrand0 | AC | 986 ms | 1008 KB |
sub_corner0 | AC | 1 ms | 256 KB |
sub_corner1 | AC | 1 ms | 256 KB |
sub_corner2 | AC | 1 ms | 256 KB |
sub_rand0 | AC | 1 ms | 256 KB |