結果
| 問題 |
No.3374 Caesar Shift Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-21 21:53:17 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 597 bytes |
| コンパイル時間 | 2,772 ms |
| コンパイル使用メモリ | 275,916 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-11-21 21:53:22 |
| 合計ジャッジ時間 | 4,472 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 35 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while(t>0){
t--;
int n;
string s;
cin >> n >> s;
int kill=0;
for(int i=0;i<n;i++){
if(i&1){
if(s[i]=='A'){s[i]='B'; kill=1;}
else if(s[i]=='B'){s[i]='C';}
else if(s[i]=='C'){break;}
}
else{
if(kill){break;}
else if(s[i]=='A'){break;}
else if(s[i]=='B'){break;}
else if(s[i]=='C'){
s[i]='A';
}
}
}
cout << s << "\n";
}
return 0;
}