結果
| 問題 | No.1455 拡張ROTN |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-12-18 02:02:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 790 bytes |
| 記録 | |
| コンパイル時間 | 733 ms |
| コンパイル使用メモリ | 67,200 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-15 03:19:39 |
| 合計ジャッジ時間 | 1,490 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 3 WA * 19 |
ソースコード
#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;
int n;cin>>n;
while(n && !allc(s)){
s = incr(s);
n--;
}
n%=26;
while(n){
s = incr(s);
n--;
}
cout << s << endl;
}