結果
問題 | No.1455 拡張ROTN |
ユーザー |
👑 ![]() |
提出日時 | 2021-03-31 21:54:28 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 534 bytes |
コンパイル時間 | 1,886 ms |
コンパイル使用メモリ | 195,772 KB |
最終ジャッジ日時 | 2025-01-20 03:23:49 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll=long long;using ull=unsigned long long;#define rep(i,n) for(int i=0; i<(n); i++)string S;ll N;char proc1(char c){if(c=='z') return 'a';if(c=='Z') return 'A';return c+1;}int main(){cin>>S>>N;rep(i,min(10ll,N)){string buf;for(char c:S){if(c=='9') buf += "CpCzNkSuTbEoA";else buf.push_back(proc1(c));}S = move(buf);}N-=min(10ll,N);N%=26;rep(i,S.size()) rep(t,N) S[i]=proc1(S[i]);cout<<S<<"\n";return 0;}