結果

問題 No.2240 WAC
ユーザー ttkkggwwttkkggww
提出日時 2023-03-10 21:50:13
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 630 bytes
コンパイル時間 4,315 ms
コンパイル使用メモリ 268,200 KB
実行使用メモリ 22,600 KB
最終ジャッジ日時 2023-10-18 07:35:36
合計ジャッジ時間 7,357 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 112 ms
22,536 KB
testcase_11 WA -
testcase_12 AC 122 ms
22,536 KB
testcase_13 AC 30 ms
10,064 KB
testcase_14 AC 13 ms
6,516 KB
testcase_15 AC 63 ms
16,168 KB
testcase_16 WA -
testcase_17 AC 53 ms
13,764 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 70 ms
17,184 KB
testcase_21 WA -
testcase_22 AC 40 ms
12,124 KB
testcase_23 AC 30 ms
10,080 KB
testcase_24 AC 64 ms
15,976 KB
testcase_25 WA -
testcase_26 AC 25 ms
8,284 KB
testcase_27 AC 18 ms
6,964 KB
testcase_28 AC 29 ms
9,076 KB
testcase_29 AC 10 ms
5,744 KB
testcase_30 AC 42 ms
12,160 KB
testcase_31 AC 92 ms
20,044 KB
testcase_32 WA -
testcase_33 AC 48 ms
12,956 KB
testcase_34 AC 58 ms
14,856 KB
testcase_35 AC 8 ms
5,296 KB
testcase_36 WA -
testcase_37 AC 77 ms
18,580 KB
testcase_38 AC 29 ms
9,608 KB
testcase_39 AC 89 ms
20,688 KB
testcase_40 AC 42 ms
12,180 KB
testcase_41 AC 56 ms
15,172 KB
testcase_42 AC 57 ms
14,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
using ll = long long;
string s;

ll n,m;

void solve(){
	set<int> W,A,C;
	for(int i = 0;i<s.size();i++){
		if(s[i]=='W'){
			W.insert(i);
		}else if(s[i]=='A'){
			A.insert(i);
		}else{
			C.insert(i);
		}
	}
	for(auto &i:C){
		auto it = A.begin();
		if(i<(*it)){
			cout<<"No"<<endl;
			return;
		}
		A.erase(it);
	}
	for(auto &i:W){
		auto it = A.begin();
		if((*it)<i){
			cout<<"No"<<endl;
			return;
		}
	}
	cout<<"Yes"<<endl;
}

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cin >> n >> m;
	cin >> s;
	solve();
}
0