結果
問題 | No.1455 拡張ROTN |
ユーザー |
👑 ![]() |
提出日時 | 2021-03-31 21:22:28 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 45 ms / 2,000 ms |
コード長 | 679 bytes |
コンパイル時間 | 423 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 59,008 KB |
最終ジャッジ日時 | 2024-12-15 14:27:25 |
合計ジャッジ時間 | 2,383 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
""""""import sysfrom sys import stdindef solve(S,N):#print (S,N)if N == 0:return Sans = []while S:i = S[-1]del S[-1]if 'a' <= i <= 'z':ans.append ( alp[(ord(i)-ord('a')+N) % 26] )elif 'A' <= i <= 'Z':ans.append ( ALP[(ord(i)-ord('A')+N) % 26] )elif int(i) + N < 10:ans.append( str(int(i)+N) )else:ans += reversed(solve(list("CpCzNkSuTbEoA") , N-(10-int(i)) ))ans.reverse()return ansS = list(input())N = int(input())alp = "abcdefghijklmnopqrstuvwxyz"ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"print ("".join(solve(S,N)))