結果

問題 No.18 うーさー暗号
ユーザー _KingdomOfMoray
提出日時 2019-11-19 11:18:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 407 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-10-03 06:23:45
合計ジャッジ時間 984 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
change_list = []
for i in range(len(s)):
    change_list.append(i)

answer_list = []

s_idx = 0
for c in s:
    real_change = (change_list[s_idx]+1) % 26

    if ord(c) - real_change < ord('A'):
        answer_list.append(chr(ord('Z') +1 - (ord('A') - (ord(c) - real_change))))
    else:
        answer_list.append(chr(ord(c) - real_change))
    s_idx += 1

res = ''.join(answer_list)
print(res)
0