結果

問題 No.3374 Caesar Shift Game
コンテスト
ユーザー The Forsaking
提出日時 2025-12-04 14:50:35
言語 C++17
(gcc 13.3.0 + boost 1.89.0)
結果
WA  
実行時間 -
コード長 573 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,665 ms
コンパイル使用メモリ 194,216 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2025-12-04 14:50:39
合計ジャッジ時間 3,810 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21 WA * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:27:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   27 |     scanf("%d", &T);
      |     ~~~~~^~~~~~~~~~
main.cpp:29:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   29 |         scanf("%d%s", &n, s + 1);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
const int N = 2000010, MOD = 998244353, INF = 0x3f3f3f3f;
int n, m, w[N];


char s[N];
void solve() {
    for (int i = 1; i < n + 1; i++) {
        if (i & 1) {
            if (s[i] == 'C') s[i] = 'A';
            else break;
        } else {
            if (s[i] != 'C') s[i]++;
            else break;
        }
    }
    puts(s + 1);
}

int main() {
    int T;
    scanf("%d", &T);
    while (T--) {
        scanf("%d%s", &n, s + 1);
        solve();
    }
    return 0;
}
0