Submission #904307
Source Code Expand
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <ctype.h> #include <deque> #include <queue> #include <cstring> #include <set> #include <list> #include <map> #include <random> #include <unordered_map> #include <stdio.h> using namespace std; typedef long long ll; typedef std::vector<int> vi; typedef std::vector<bool> vb; typedef std::vector<string> vs; typedef std::vector<double> vd; typedef std::vector<long long> vll; typedef std::vector<std::vector<int> > vvi; typedef vector<vvi> vvvi; typedef vector<vll> vvll; typedef std::vector<std::pair<int, int> > vpi; typedef vector<vpi> vvpi; typedef std::pair<int, int> pi; typedef std::pair<ll, ll> pll; typedef std::vector<pll> vpll; const long long mod = 1000000007; #define all(c) (c).begin(),(c).end() #define sz(c) (int)(c).size() #define forn(i, a, b) for(int i = a; i < b; i++) #define pb push_back #define mp make_pair int main() { //#ifndef ONLINE_JUDGE // freopen("input.txt", "rt", stdin); // freopen("output.txt", "wt", stdout); //#endif string s; getline(cin, s); string t; for(auto x : s) { if(t.size()>0 && t.back() == 'S' && x=='T') { t.pop_back(); } else t.pb(x); } cout << t.size(); }
Submission Info
Submission Time | |
---|---|
Task | A - STring |
User | Vercingetorix |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1334 Byte |
Status | AC |
Exec Time | 11 ms |
Memory | 776 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 | 11 ms | 644 KB |
corner1 | AC | 11 ms | 776 KB |
corner2 | AC | 11 ms | 640 KB |
example0 | AC | 3 ms | 256 KB |
example1 | AC | 3 ms | 256 KB |
example2 | AC | 3 ms | 256 KB |
handmade0 | AC | 2 ms | 256 KB |
handmade1 | AC | 3 ms | 256 KB |
maxrand0 | AC | 11 ms | 640 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 | 3 ms | 256 KB |