結果

問題 No.18 うーさー暗号
ユーザー PeachCaStellaPeachCaStella
提出日時 2022-08-02 23:40:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 532 bytes
コンパイル時間 1,566 ms
コンパイル使用メモリ 170,916 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-10-01 00:11:37
合計ジャッジ時間 2,514 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;

int main() {
    string S,a;
    cin >> S;
    a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    map<char,char> M;
    int N = S.size();
    for (int i = 0; i < 26; i++) {
        M[a[i]] = a[(i+25)%26];
    }
    for (int i = 0; i < N; i++) {
        for (int j = i; j < N; j++) {
            S[j] = M[S[j]];
        }
    }
    cout << S << endl;
}
0