結果

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

ソースコード

diff #

def to_ord(s: str):
    return ord(s) - 65


def to_chr(c):
    return chr(c+65)


S = input()
len_S = len(S)

code = list(map(to_ord, S))
shift = list(range(1, len(S) + 1))
ans_code = [(i - j) % 26 for i, j in zip(code, shift)]

ans = ''.join(map(to_chr, ans_code))
print(ans)
0