結果
| 問題 |
No.2240 WAC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-10 21:48:27 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 6 ms / 2,000 ms |
| コード長 | 920 bytes |
| コンパイル時間 | 768 ms |
| コンパイル使用メモリ | 85,212 KB |
| 最終ジャッジ日時 | 2025-02-11 08:08:44 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 43 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:25:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
25 | scanf("%d %d", &n, &m);
| ~~~~~^~~~~~~~~~~~~~~~~
main.cpp:26:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
26 | scanf("%s", ib);
| ~~~~~^~~~~~~~~~
ソースコード
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include <map>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <algorithm>
#include <array>
#include <unordered_set>
#include <unordered_map>
#include <string>
using namespace std;
bool rcmp(int a, int b) { return a>b; }
typedef long long LL;
char ib[400004];
int main() {
int n, i, m, nn, j;
scanf("%d %d", &n, &m);
scanf("%s", ib);
nn = m+n+m+n;
i=j=0;
while(1) {
while(i<nn&&ib[i]!='C') i++;
if (i>=nn) break;
while(j<i&&ib[j]!='A') j++;
if (j>=i) { printf("No\n"); return 0; }
j++;
i++;
}
i=0;
while(1) {
while(j<nn&&ib[j]!='A') j++;
if (j>=nn) break;
while(i<j&&ib[i]!='W') i++;
if (i>=j) { printf("No\n"); return 0; }
j++;
i++;
}
printf("Yes\n");
return 0;
}