結果
問題 | No.1455 拡張ROTN |
ユーザー |
|
提出日時 | 2021-03-31 21:30:59 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 605 bytes |
コンパイル時間 | 473 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-15 15:24:49 |
合計ジャッジ時間 | 2,035 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 22 |
ソースコード
s = input() n = int(input()) ans = "" for i in s: if i.isdigit(): now = "CpCzNkSuTbEoA" shift = (n - (10 - int(i))) % 26 new = "" for j in now: if j.islower(): new += chr((ord(j) - ord("a") + shift) % 26 + ord("a")) else: new += chr((ord(j) - ord("A") + shift) % 26 + ord("A")) ans += new elif i.islower(): shift = n % 26 ans += chr((ord(i) - ord("a") + shift) % 26 + ord("a")) else: shift = n % 26 ans += chr((ord(i) - ord("A") + shift) % 26 + ord("A")) print(ans)