結果

問題 No.18 うーさー暗号
ユーザー mitsushinomitsushino
提出日時 2017-12-04 17:39:34
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 64 ms / 5,000 ms
コード長 469 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-07-07 06:40:11
合計ジャッジ時間 1,160 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'


def usa_code(idx, c):
    alphabet_idx = alphabet.index(c)
    while idx > 0:
        alphabet_idx -= 1
        if alphabet_idx < 0:
            alphabet_idx = len(alphabet) - 1
        idx -= 1
    return alphabet[alphabet_idx]


if __name__ == '__main__':
    input_str = input()
    joint_str = ''
    for idx, c in enumerate(input_str, 1):
        joint_str += usa_code(idx, c)
    print(joint_str)
0