Submission #3260769
Source Code Expand
#include <bits/stdc++.h>
#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
typedef long long ll;
using namespace std;
const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;
long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};
//-------------------------↓↓↓↓↓↓------------------------
int main(void){
cin.tie(0);
ios::sync_with_stdio(false);
cin>>n>>a>>b>>s;
ans=0;
rep(i,n){
if(s[i]=='a'){
if(ans<a+b)Cout("Yes"),ans++;
else Cout("No");
}
else{
if(s[i]=='c')Cout("No");
else{
if(ans<a+b){
if(cnt<b)Cout("Yes"),cnt++,ans++;
else Cout("No");
}
else Cout("No");
}
}
//Cout(ans);
}
return 0;
}
Submission Info
Submission Time |
|
Task |
B - Qualification simulator |
User |
asdf1 |
Language |
C++14 (GCC 5.4.1) |
Score |
200 |
Code Size |
1258 Byte |
Status |
AC |
Exec Time |
148 ms |
Memory |
848 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 |
145 ms |
720 KB |
02.txt |
AC |
146 ms |
848 KB |
03.txt |
AC |
146 ms |
848 KB |
04.txt |
AC |
148 ms |
848 KB |
05.txt |
AC |
127 ms |
640 KB |
06.txt |
AC |
144 ms |
720 KB |
07.txt |
AC |
147 ms |
848 KB |
08.txt |
AC |
146 ms |
848 KB |
09.txt |
AC |
144 ms |
848 KB |
10.txt |
AC |
144 ms |
848 KB |
s1.txt |
AC |
1 ms |
256 KB |
s2.txt |
AC |
1 ms |
256 KB |
s3.txt |
AC |
1 ms |
256 KB |