Submission #1162881


Source Code Expand

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cmath>
#include <complex>
#include <cctype>
#include <cassert>
#include <sstream>
#include <ctime>
 
using namespace std;
 
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
 
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
 
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> P;
typedef vector<pii> vp;

#define INF (1<<29)
#define INFL (1ll<<60)
#define EPS (1e-8)
#define PI (acos(-1))
const ll MOD = 1000000007ll;

int main() {
	int n, a, b;
	cin >> n >> a >>b;
	
	string s;
	cin >> s;
	
	int now = 0, cnt = 1;
	REP(i, s.size()) {
		bool ok = true;
		
		if (a + b <= now) ok = false;
		else {
			if (s[i] == 'b') {
				if (cnt <= b) cnt++;
				else ok = false;
			}
			if (s[i] == 'c') ok = false;
		}
		
		if (ok) {
			puts("Yes");
			now++;
		}
		else 
			puts("No");
	}
	
	return 0;
}

Submission Info

Submission Time
Task B - Qualification simulator
User tkmst201
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1298 Byte
Status AC
Exec Time 7 ms
Memory 896 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 13
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 6 ms 768 KB
02.txt AC 7 ms 768 KB
03.txt AC 7 ms 768 KB
04.txt AC 7 ms 768 KB
05.txt AC 6 ms 768 KB
06.txt AC 6 ms 768 KB
07.txt AC 7 ms 896 KB
08.txt AC 7 ms 896 KB
09.txt AC 6 ms 768 KB
10.txt AC 7 ms 768 KB
s1.txt AC 1 ms 256 KB
s2.txt AC 1 ms 256 KB
s3.txt AC 1 ms 256 KB