Submission #904459


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

const int N = 1000005;
char str[N] , s[N];
int n , top;


int main() {
    scanf("%s" , str);
    n = strlen(str);

    for (int i = 0 ; i < n ; ++ i) {
        s[top ++] = str[i];
        while (top > 2 && s[top - 2] == 'S' && s[top - 1] == 'T') {
            top -= 2;
        }
    }
    printf("%d\n" , top);
    return 0;
}

Submission Info

Submission Time
Task A - STring
User sd0061
Language C++14 (GCC 5.4.1)
Score 0
Code Size 397 Byte
Status WA
Exec Time 5 ms
Memory 640 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:10:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s" , str);
                      ^

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 0 / 200 0 / 100
Status
AC × 2
WA × 1
AC × 5
WA × 4
AC × 7
WA × 6
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 WA 4 ms 512 KB
corner1 AC 4 ms 640 KB
corner2 AC 4 ms 512 KB
example0 AC 3 ms 256 KB
example1 WA 3 ms 256 KB
example2 AC 3 ms 256 KB
handmade0 WA 3 ms 256 KB
handmade1 AC 3 ms 256 KB
maxrand0 WA 5 ms 384 KB
sub_corner0 WA 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