Submission #1654219
Source Code Expand
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <tuple>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#define REP(i, n) for(LL i = 0;i < n;i++)
#define REPR(i, n) for(LL i = n;i >= 0;i--)
#define FOR(i, m, n) for(LL i = m;i < n;i++)
#define FORR(i, m, n) for(LL i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef long long LL;
//typedef LL int;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;
typedef pair<int, P> PP;
typedef pair<LL, LP> LPP;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
int main(){
int n, a, b;
string s;
cin >> n >> a >> b >> s;
int cnt = 0;
int bstu = 0;
REP(i, n){
if(s[i] == 'a'){
if(cnt < a + b){
cout << "Yes" << endl;
cnt++;
}else {
cout << "No" << endl;
}
}else if(s[i] == 'b'){
if(cnt < a + b && bstu < b){
cout << "Yes" << endl;
cnt++; bstu++;
}else{
cout << "No" << endl;
}
}else{
cout << "No" << endl;
}
}
}
Submission Info
Submission Time |
|
Task |
B - Qualification simulator |
User |
wheson |
Language |
C++14 (GCC 5.4.1) |
Score |
200 |
Code Size |
1420 Byte |
Status |
AC |
Exec Time |
168 ms |
Memory |
896 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
200 / 200 |
Status |
|
|
Set Name |
Test Cases |
Sample |
s1.txt, s2.txt, s3.txt |
All |
01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, s1.txt, s2.txt, s3.txt |
Case Name |
Status |
Exec Time |
Memory |
01.txt |
AC |
162 ms |
768 KB |
02.txt |
AC |
163 ms |
768 KB |
03.txt |
AC |
164 ms |
768 KB |
04.txt |
AC |
166 ms |
768 KB |
05.txt |
AC |
143 ms |
768 KB |
06.txt |
AC |
165 ms |
768 KB |
07.txt |
AC |
164 ms |
896 KB |
08.txt |
AC |
168 ms |
896 KB |
09.txt |
AC |
165 ms |
768 KB |
10.txt |
AC |
161 ms |
768 KB |
s1.txt |
AC |
1 ms |
256 KB |
s2.txt |
AC |
1 ms |
256 KB |
s3.txt |
AC |
1 ms |
256 KB |