提出 #916761
ソースコード 拡げる
#include<bits/stdc++.h>
#define REP(x,y,z) for(int x=y;x<=z;x++)
#define FORD(x,y,z) for(int x=y;x>=z;x--)
#define MSET(x,y) memset(x,y,sizeof(x))
#define FOR(x,y) for(__typeof(y.begin()) x=y.begin();x!=y.end();x++)
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define SZ size()
#define M 100005
void RI(){}
template<typename... T>
void RI( int& head, T&... tail ) {
scanf("%d",&head);
RI(tail...);
}
using namespace std;
typedef long long LL;
int n,a,b;
char in[M];
int main()
{
while(~scanf("%d %d %d",&n,&a,&b))
{
scanf("%s",in);
int ca=0, cb=0;
REP(i,0,n-1)
{
if(in[i]=='a' && ca+cb<a+b)
{
ca++;
puts("Yes");
}
else if(in[i]=='b' && ca+cb<a+b && cb<b)
{
cb++;
puts("Yes");
}
else puts("No");
}
}
return 0;
}
提出情報
コンパイルエラー
./Main.cpp: In function ‘int main()’:
./Main.cpp:26:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s",in);
^
ジャッジ結果
| セット名 |
Sample |
All |
| 得点 / 配点 |
0 / 0 |
200 / 200 |
| 結果 |
|
|
| セット名 |
テストケース |
| 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 |
6 ms |
640 KiB |
| 02.txt |
AC |
6 ms |
640 KiB |
| 03.txt |
AC |
6 ms |
640 KiB |
| 04.txt |
AC |
6 ms |
640 KiB |
| 05.txt |
AC |
5 ms |
640 KiB |
| 06.txt |
AC |
5 ms |
640 KiB |
| 07.txt |
AC |
6 ms |
768 KiB |
| 08.txt |
AC |
6 ms |
768 KiB |
| 09.txt |
AC |
5 ms |
640 KiB |
| 10.txt |
AC |
5 ms |
768 KiB |
| s1.txt |
AC |
2 ms |
256 KiB |
| s2.txt |
AC |
2 ms |
256 KiB |
| s3.txt |
AC |
2 ms |
256 KiB |