Submission #912520


Source Code Expand

#include <iostream>
#include <string>
#include <stack>
using namespace std;

int main()
{
    string x; cin>>x;
    stack<char> s;

    for(e: x) {
        if (e=='T' and s.size() and s.top()=='S')
            s.pop();
        else
            s.push(e);
    }
    cout<<s.size()<<endl;
}

Submission Info

Submission Time
Task A - STring
User hogeover30
Language C++14 (GCC 5.4.1)
Score 300
Code Size 307 Byte
Status AC
Exec Time 10 ms
Memory 644 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:11:8: warning: range-based for loop without a type-specifier only available with -std=c++1z or -std=gnu++1z
     for(e: x) {
        ^

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 200 / 200 100 / 100
Status
AC × 3
AC × 9
AC × 13
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 10 ms 640 KB
corner1 AC 10 ms 644 KB
corner2 AC 10 ms 640 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 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