Submission #905110
Source Code Expand
#include <algorithm> #include <cstdio> #include <ctype.h> #include <functional> #include <iostream> #include <cassert> #include <cfloat> #include <climits> #include <complex> #include <cstdlib> #include <cstring> #include <cmath> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <vector> using namespace std; int main() { string S; cin >> S; int a = 0; int b = 0; int res=0; for (int i = 0; i < S.size(); i++) { if (S[i] == 'S') { a++; } else { if (a == 0) { res+=2; } else { a--; } b++; } } cout << res << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - STring |
User | ats5515 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 699 Byte |
Status | AC |
Exec Time | 10 ms |
Memory | 640 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 | 9 ms | 640 KB |
corner1 | AC | 9 ms | 640 KB |
corner2 | AC | 10 ms | 640 KB |
example0 | AC | 2 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 | AC | 10 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 |