結果

問題 No.18 うーさー暗号
ユーザー iad_2889iad_2889
提出日時 2019-05-08 06:51:11
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 317 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-07-02 00:23:56
合計ジャッジ時間 1,117 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

alpha = [chr(ord("A") + i) for i in range(26)]
def get_alphabet_after_n(current = "A",next = 1):
    current = ord(current) - 65
    next=current-next
    next%=26
    if next < 0:
        next+=26
    return alpha[next]

S = input()
usa = ""
for i,s in enumerate(S):
    usa+=get_alphabet_after_n(s,i + 1)
print(usa)
0