結果

問題 No.18 うーさー暗号
ユーザー トミートミー
提出日時 2024-02-17 19:16:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 338 bytes
コンパイル時間 2,076 ms
コンパイル使用メモリ 201,264 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-17 19:16:46
合計ジャッジ時間 3,243 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int mod(int x, int y)
{
    int n = x % y;
    return n + (n < 0) * y;
}

int main()
{
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++)
    {
        char c = s[i];
        c -= ('A' + i + 1);
        c = mod(c, 26) + 'A';
        cout << c;
    }
    // system("pause");
}
0