Submission #2597159


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;

using int64 = long long;


int main() {
  int A, B, N;
  string X;

  cin >> A >> B >> N;
  cin >> X;
  for(int i = 0; i < N; i++) {
    if(X[i] == 'S') A = max(A - 1, 0);
    else if(X[i] == 'C') B = max(B - 1, 0);
    else if(A >= B) A = max(A - 1, 0);
    else B = max(B - 1, 0);
  }
  cout << A << endl;
  cout << B << endl;
}

Submission Info

Submission Time
Task B - 洋菓子店
User ei13333
Language C++14 (GCC 5.4.1)
Score 200
Code Size 399 Byte
Status
Exec Time 4 ms
Memory 512 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt
All 200 / 200 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt
Case Name Status Exec Time Memory
01.txt 4 ms 384 KB
02.txt 3 ms 384 KB
03.txt 3 ms 384 KB
04.txt 3 ms 384 KB
05.txt 2 ms 256 KB
06.txt 4 ms 512 KB
07.txt 1 ms 256 KB
08.txt 1 ms 256 KB
sample-01.txt 1 ms 256 KB
sample-02.txt 1 ms 256 KB
sample-03.txt 1 ms 256 KB
sample-04.txt 1 ms 256 KB