Submission #1354607


Source Code Expand

#include<stdio.h>
#include<assert.h>
#include<vector>
#include<string.h>
#include<algorithm>
#include<memory.h>
#include<cmath>
#include<string>
#include<iostream>
#include<set>
#include<unordered_set>
#include<map>
#include<queue>
#include<functional>
#include<list>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double, double> pdd;
typedef tuple<int,int,int> t3;

const int MX = 1<<17;
const int MM = 1000000007;

int main()
{
	string D, E = "";
	cin >> D;
	for(char c : D){
		if( E.size() && E.back() == 'S' && c == 'T' ) E.pop_back();
		else E += c;
	}
	printf("%d\n", E.size());
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:36:25: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::basic_string<char>::size_type {aka long unsigned int}’ [-Wformat=]
  printf("%d\n", E.size());
                         ^

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 9 ms 644 KB
corner1 AC 9 ms 776 KB
corner2 AC 9 ms 640 KB
example0 AC 1 ms 256 KB
example1 AC 1 ms 256 KB
example2 AC 1 ms 256 KB
handmade0 AC 1 ms 256 KB
handmade1 AC 1 ms 256 KB
maxrand0 AC 10 ms 640 KB
sub_corner0 AC 1 ms 256 KB
sub_corner1 AC 1 ms 256 KB
sub_corner2 AC 1 ms 256 KB
sub_rand0 AC 1 ms 256 KB