結果
| 問題 |
No.1455 拡張ROTN
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2021-12-18 02:03:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 796 bytes |
| コンパイル時間 | 648 ms |
| コンパイル使用メモリ | 67,328 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-15 03:20:18 |
| 合計ジャッジ時間 | 1,499 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
#include <iostream>
using namespace std;
string incr(string s){
string ans = "";
for(int i = 0; s.size() > i; i++){
if('a' <= s[i] && s[i] <= 'z'){
if(s[i] == 'z')ans.push_back('a');
else ans.push_back(s[i]+1);
}else if('A' <= s[i] && s[i] <= 'Z'){
if(s[i] == 'Z')ans.push_back('A');
else ans.push_back(s[i]+1);
}else if(s[i] == '9'){
ans = ans+"CpCzNkSuTbEoA";
}else{
ans.push_back(s[i]+1);
}
}
return ans;
}
bool allc(string s){
for(int i = 0; s.size() > i; i++){
if('0' <= s[i] && s[i] <= '9'){
return false;
}
}
return true;
}
int main(){
string s;cin>>s;
long long n;cin>>n;
while(n && !allc(s)){
s = incr(s);
n--;
}
n%=26;
while(n){
s = incr(s);
n--;
}
cout << s << endl;
}