提出 #1555273


ソースコード 拡げる

#include <iostream>
#include <cstdio>
#include <string>
#include <queue>
#include <stack>
#include <list>
#include <algorithm>
#include <vector>
#define REP(i,n) for(int i=0;i<n;i++)
#define P 1000000007
using namespace std;

int powmp(long long x,long long n){
	const long long p = 1000000007;
	if(n==0) return 1;
	long long y = x%p;
	if(n==1) return y;
	long long tmp = (powmp(y,n/2))%p;
	if(n%2==0) return (tmp*tmp)%p;
	else return (powmp(y,n-1)*y)%p;
}

int main(int argc, char const *argv[])
{
	int n,a,b;
	cin >> n >> a >> b;
	int c = 0;
	int cf = 0;
	string str;
	cin >> str;
	REP(i,n){
		if(str[i]=='a'){
			if(c<a+b){
				cout << "Yes" << "\n";
				c++;
			}
			else cout <<"No"<<"\n";
		}
		else if(str[i]=='b'){
			if(c<a+b&&cf<b){
				cout << "Yes" << "\n";
				c++;
			}
			else cout <<"No"<<"\n";
			cf++;
		}
		else{
			cout <<"No"<<"\n";
		}
	}

	cout << "\n";
	return 0;
}	

提出情報

提出日時
問題 B - Qualification simulator
ユーザ toufuneko
言語 C++14 (GCC 5.4.1)
得点 200
コード長 943 Byte
結果 AC
実行時間 11 ms
メモリ 896 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 13
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
01.txt AC 11 ms 768 KiB
02.txt AC 11 ms 768 KiB
03.txt AC 11 ms 768 KiB
04.txt AC 11 ms 768 KiB
05.txt AC 9 ms 768 KiB
06.txt AC 10 ms 768 KiB
07.txt AC 11 ms 896 KiB
08.txt AC 11 ms 896 KiB
09.txt AC 10 ms 768 KiB
10.txt AC 10 ms 768 KiB
s1.txt AC 1 ms 256 KiB
s2.txt AC 1 ms 256 KiB
s3.txt AC 1 ms 256 KiB