Submission #1354611
Source Code Expand
#include <bits/stdc++.h> #define pb push_back using namespace std; int N; vector<int> a; char s[100010]; int main(){ scanf("%s",s); N = strlen(s); for(int i=0; i<N; i++){ if(s[i] == 'S') a.pb(0); else{ if(a.size() != 0 && a.back() == 0){ a.pop_back(); } } } printf("%d\n",a.size()); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - STring |
User | suhgyuho |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 345 Byte |
Status | RE |
Exec Time | 99 ms |
Memory | 384 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:22:24: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::vector<int>::size_type {aka long unsigned int}’ [-Wformat=] printf("%d\n",a.size()); ^ ./Main.cpp:12:15: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%s",s); ^
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 | RE | 97 ms | 384 KB |
corner1 | RE | 98 ms | 384 KB |
corner2 | RE | 97 ms | 384 KB |
example0 | WA | 1 ms | 256 KB |
example1 | AC | 1 ms | 256 KB |
example2 | WA | 1 ms | 256 KB |
handmade0 | AC | 1 ms | 256 KB |
handmade1 | WA | 1 ms | 256 KB |
maxrand0 | RE | 99 ms | 384 KB |
sub_corner0 | AC | 1 ms | 256 KB |
sub_corner1 | WA | 1 ms | 256 KB |
sub_corner2 | WA | 1 ms | 256 KB |
sub_rand0 | WA | 1 ms | 256 KB |