結果

問題 No.1455 拡張ROTN
ユーザー MAHAYANA
提出日時 2023-10-23 22:45:37
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 727 bytes
コンパイル時間 1,564 ms
コンパイル使用メモリ 169,420 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-09-22 16:02:31
合計ジャッジ時間 5,108 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other TLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,m,n) for(int i=m; i<n; ++i)
#define repl(i,m,n) for(ll i=m; i<n; ++i)

string shift(string &S){
    string res = "";
    for(char &c : S){
        if('a' <= c && c <= 'z'){
            if(c == 'z') res += 'a';
            else res += char(c + 'b' - 'a');
        }else if('A' <= c && c <= 'Z'){
            if(c == 'Z') res += 'A';
            else res += char(c + 'B' - 'A');
        }else{
            if(c == '9') res += "CpCzNkSuTbEoA";
            else res += char(c + '1' - '0');
        }
    }
    return res;
}

int main(){
    string S;
    int N;
    cin >> S >> N;
    rep(i, 0, N) S = shift(S);
    cout << S << endl;
    return 0;
}
0