結果
| 問題 | No.1455 拡張ROTN |
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2025-07-03 21:29:32 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 62 ms / 2,000 ms |
| + 608µs | |
| コード長 | 754 bytes |
| 記録 | |
| コンパイル時間 | 229 ms |
| コンパイル使用メモリ | 95,472 KB |
| 実行使用メモリ | 78,720 KB |
| 最終ジャッジ日時 | 2026-07-13 00:28:36 |
| 合計ジャッジ時間 | 3,232 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
L = "abcdefghijklmnopqrstuvwxyz"
U = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
key = "CpCzNkSuTbEoA"
K = "CpCzNkSuTbEoA"
Num = []
dicl = {}
dicu = {}
for i in range(26):
dicl[L[i]] = i
dicu[U[i]] = i
for i in range(26):
Num.append(K)
K2 = ""
for s in K:
if s.islower():
K2 += L[(dicl[s] + 1) % 26]
else:
K2 += U[(dicu[s] + 1) % 26]
K = K2
S = input()
N = int(input())
ans = []
for s in S:
if s.isdecimal():
s = int(s)
if s + N < 10:
ans.append(str(s + N))
else:
x = (s + N - 10) % 26
ans.append(Num[x])
elif s.islower():
ans.append(L[(dicl[s] + N) % 26])
else:
ans.append(U[(dicu[s] + N) % 26])
print("".join(ans))
ntuda