結果

問題 No.1455 拡張ROTN
ユーザー nasubi24nasubi24
提出日時 2021-03-31 21:21:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 570 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 76,608 KB
最終ジャッジ日時 2023-08-21 22:35:16
合計ジャッジ時間 3,217 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
76,464 KB
testcase_01 AC 78 ms
76,452 KB
testcase_02 AC 80 ms
76,484 KB
testcase_03 AC 79 ms
76,576 KB
testcase_04 AC 79 ms
76,608 KB
testcase_05 AC 79 ms
76,284 KB
testcase_06 AC 81 ms
76,072 KB
testcase_07 AC 80 ms
76,500 KB
testcase_08 AC 80 ms
76,452 KB
testcase_09 AC 78 ms
76,456 KB
testcase_10 AC 79 ms
76,172 KB
testcase_11 AC 78 ms
76,512 KB
testcase_12 AC 78 ms
76,368 KB
testcase_13 AC 78 ms
76,516 KB
testcase_14 AC 78 ms
76,396 KB
testcase_15 AC 79 ms
76,460 KB
testcase_16 AC 78 ms
76,520 KB
testcase_17 AC 78 ms
76,576 KB
testcase_18 AC 79 ms
76,512 KB
testcase_19 AC 80 ms
76,604 KB
testcase_20 AC 79 ms
76,460 KB
testcase_21 AC 79 ms
76,592 KB
testcase_22 AC 79 ms
76,472 KB
testcase_23 AC 79 ms
76,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input()
n=int(input())
cnt1=["CpCzNkSuTbEoA"]
for i in range(150):
    ans=""
    s1=cnt1[-1]
    for j in range(len(s1)):
        a=ord(s1[j])
        if a<92:
            ans+=chr(65+(a-65+1)%26)
        else:
            ans+=chr(97+(a-97+1)%26)
    cnt1.append(ans)
ans=""
m=n%26
k=n%10
for i in range(len(s)):
    a=ord(s[i])
    if a<65:
        if int(s[i])+n>9:
            ans+=cnt1[(int(s[i])+n-10)%26]
        else:
            ans+=str((int(s[i])+k)%10)
    elif a<92:
        ans+=chr(65+(a-65+m)%26)
    else:
        ans+=chr(97+(a-97+m)%26)
print(ans)
0