結果
| 問題 |
No.1455 拡張ROTN
|
| コンテスト | |
| ユーザー |
OR6107
|
| 提出日時 | 2021-03-31 22:56:37 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 43 ms / 2,000 ms |
| コード長 | 870 bytes |
| コンパイル時間 | 237 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-12-15 21:30:05 |
| 合計ジャッジ時間 | 2,008 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
def replace(n, s):
for j in range(n):
ss = ""
for i in range(len(s)):
c = s[i]
if c == 'z':
c = 'a'
elif c == 'Z':
c = 'A'
else:
c = chr(ord(c)+1)
ss += c
s = ss
return s
text = "CpCzNkSuTbEoA"
s = input()
n = int(input())
new = ""
alpha = []
for i in range(len(s)):
if '0' <= s[i] and s[i] <= '9':
num = int(s[i])
if n < 10:
if 10-num <= n:
new += replace((n+num)-10, text)
else:
new += chr(ord(s[i])+n)
else:
new += replace(26-(10-num), text)
else:
if n < 26:
new += replace(n, s[i])
else:
new += replace(26, s[i])
if n > 26:
n %= 26
print(replace(n, new))
else:
print(new)
OR6107