結果

問題 No.2034 Anti Lexicography
ユーザー ロク@マジミラ2023(幕張)9/1~9/3参加ロク@マジミラ2023(幕張)9/1~9/3参加
提出日時 2023-08-03 10:26:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 805 bytes
コンパイル時間 4,529 ms
コンパイル使用メモリ 164,520 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-21 08:44:17
合計ジャッジ時間 3,552 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 3 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 13 ms
6,940 KB
testcase_06 AC 13 ms
6,944 KB
testcase_07 AC 13 ms
6,944 KB
testcase_08 AC 13 ms
6,940 KB
testcase_09 AC 13 ms
6,940 KB
testcase_10 AC 13 ms
6,944 KB
testcase_11 AC 14 ms
6,944 KB
testcase_12 AC 13 ms
6,940 KB
testcase_13 AC 3 ms
6,944 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 3 ms
6,944 KB
testcase_17 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int ctoi(char c){
    switch(c){
        case '1': return 1;
        case '2': return 2;
        case '3': return 3;
        case '4': return 4;
        case '5': return 5;
        case '6': return 6;
        case '7': return 7;
        case '8': return 8;
        case '9': return 9;
        default: return 0;
    }
}

int main() {
    int n;
    string s;
    cin >> n >> s;
    vector<char> alphabet = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};;

    for(int i = 0; i < n; i++){
        for(int j = 0; j < 26; j++){
            if(s.at(i) == alphabet[j]) {
                cout << alphabet[alphabet.size() - j - 1];
                break;
            }
        }
    }
    cout << endl;
}

0