Submission #9683466
Source Code Expand
#include <bits/stdc++.h> #define sz(arr) (int)(arr).size() #define rng(arr) arr.begin(), arr.end() #define show(x) cout << #x << " = " << x << endl; using namespace std; typedef long long int ll; void _cin() {} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail) { cin >> head; _cin(forward<Tail>(tail)...); } #define Cin(T, ...) \ T __VA_ARGS__; \ _cin(__VA_ARGS__) #define Cins(T, n, xs) \ vector<T> xs(n); \ for (int i = 0; i < n; ++i) cin >> xs[i] void Main(); int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); Main(); return 0; } void Main() { Cin(int, a, b, n); Cin(string, x); for (auto e : x) { if (e == 'S') a = max(0, a - 1); else if (e == 'C') b = max(0, b - 1); else if (e == 'E') { if (a >= b) a = max(0, a - 1); else b = max(0, b - 1); } } cout << a << endl; cout << b << endl; }
Submission Info
Submission Time | |
---|---|
Task | B - 洋菓子店 |
User | kjmo |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1012 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 384 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt |
All | 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 | AC | 2 ms | 384 KB |
02.txt | AC | 2 ms | 384 KB |
03.txt | AC | 2 ms | 384 KB |
04.txt | AC | 2 ms | 384 KB |
05.txt | AC | 1 ms | 256 KB |
06.txt | AC | 2 ms | 384 KB |
07.txt | AC | 1 ms | 256 KB |
08.txt | AC | 1 ms | 256 KB |
sample-01.txt | AC | 1 ms | 256 KB |
sample-02.txt | AC | 1 ms | 256 KB |
sample-03.txt | AC | 1 ms | 256 KB |
sample-04.txt | AC | 1 ms | 256 KB |