Submission #1076994
Source Code Expand
#include <bits/stdc++.h> #define rep(i,a,b) for(int i=(a); i<(b); i++) #define all(c) (c).begin(),(c).end() #define rall(c) (c).rbegin(),(c).rend() #define sort(v,n) sort(v,v+n); #define vsort(v) sort(v.begin(),v.end()); #define ll long long #define pb(a) push_back(a) #define fi first #define se second #define inf 999999999 using namespace std; typedef pair<int,int> p; typedef pair<ll,ll> lp; bool is_uruu(int y) { return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); } const ll MOD=1e9+7; //---------------------------------------------------------------------------// int main(){ string s; cin>>s; int i=0; while(1) { if(s.substr(i,2)=="ST" && s.length()>2) { s=s.substr(0,i)+s.substr(i+2,s.length()-i-2); i=0; }else if(s.substr(0,2)=="ST" && s.length()==2) { cout<<0<<endl; return 0; } if(i==s.length()-1) { break; } i++; } cout<<s.length()<<endl; }
Submission Info
Submission Time | |
---|---|
Task | A - STring |
User | aim_cpo |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1170 Byte |
Status | WA |
Exec Time | 1054 ms |
Memory | 1136 KB |
Judge Result
Set Name | Sample | Subtask1 | All | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 1054 ms | 1020 KB |
corner1 | TLE | 1054 ms | 1136 KB |
corner2 | TLE | 1054 ms | 1020 KB |
example0 | AC | 3 ms | 256 KB |
example1 | AC | 3 ms | 256 KB |
example2 | AC | 3 ms | 256 KB |
handmade0 | AC | 3 ms | 256 KB |
handmade1 | AC | 3 ms | 256 KB |
maxrand0 | TLE | 1054 ms | 1004 KB |
sub_corner0 | AC | 3 ms | 256 KB |
sub_corner1 | AC | 3 ms | 256 KB |
sub_corner2 | WA | 3 ms | 256 KB |
sub_rand0 | AC | 3 ms | 256 KB |