-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB.cpp
More file actions
47 lines (41 loc) · 1.2 KB
/
B.cpp
File metadata and controls
47 lines (41 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define reps(i, s, n) for (int i = s; i < (n); ++i)
#define all(it) it.begin(),it.end()
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) a / __gcd(a, b) * b
#define out(a) cout << a << endl
using namespace std;
using ll=long long;
using ld = long double;
using ull = unsigned long long;
const int INF = 2e9;
template<typename T> void print(T n){cerr<<n<<endl;}
template<typename T> void print(vector<T> v){for(auto i:v){cerr<<i<<" ";}cerr<<endl;}
template<typename T,typename U> void print(map<T, U> mp){for(auto el:mp){cerr<<el.first<<": "<<el.second<<endl;}}
template<typename T> bool chmax(T& a,const T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T& a,const T b){if(a>b){a=b;return true;}return false;}
double pi = 3.141592653589793238;
int main() {
int n,a,b;
cin >> n >> a >> b;
int total=a+b;
int curr=0;
int rank=b,abrank=0;
string s;
char c;
cin >> s;
rep(i,n) {
c=s[i];
if (c=='a' && curr < total) {
curr++;
out("Yes");
}
else if (c=='b' && curr < total && abrank < rank) {
curr++;
abrank++;
out("Yes");
}
else out("No");
}
}