結果
| 問題 | No.3374 Caesar Shift Game |
| コンテスト | |
| ユーザー |
テナガザル
|
| 提出日時 | 2025-11-21 22:14:40 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 17 ms / 2,000 ms |
| + 535µs | |
| コード長 | 643 bytes |
| 記録 | |
| コンパイル時間 | 1,139 ms |
| コンパイル使用メモリ | 168,488 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-16 21:01:56 |
| 合計ジャッジ時間 | 3,645 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 35 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
void solve()
{
int n;
cin >> n;
string s;
cin >> s;
int flag = 0;
for (int i = 0; i < n; ++i)
{
if (i % 2 == 0)
{
if (flag || s[i] != 'C')
{
cout << s << endl;
return;
}
else
{
s[i] = 'A';
}
}
else
{
if (s[i] == 'C')
{
cout << s << endl;
return;
}
else
{
if (s[i] == 'A') flag = 1;
++s[i];
}
}
}
cout << s << endl;
}
int main()
{
int t;
cin >> t;
while (t--) solve();
}
テナガザル