結果
問題 |
No.2278 Time Bomb Game 2
|
ユーザー |
|
提出日時 | 2023-04-24 16:58:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 548 bytes |
コンパイル時間 | 871 ms |
コンパイル使用メモリ | 65,792 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 17:57:20 |
合計ジャッジ時間 | 2,701 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 67 WA * 3 |
ソースコード
#include<iostream> using namespace std; int N,K,T; string C; bool win() { int l=K,r=K; while(l>=0&&C[l]=='A')l--; while(r<N&&C[r]=='A')r++; int ret=1e9; if(l>=0)ret=min(ret,K-l); if(r<N)ret=min(ret,r-K); if(ret<(int)1e9&&ret%2==T%2&&ret<=T)return true; return false; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N>>K>>T>>C; K--; if(C[K]=='A') { if(win())cout<<"Alice"<<endl; else cout<<"Bob"<<endl; } else { for(char&c:C)c=c=='A'?'B':'A'; if(!win())cout<<"Alice"<<endl; else cout<<"Bob"<<endl; } }