結果

問題 No.18 うーさー暗号
コンテスト
ユーザー mitsushino
提出日時 2017-12-04 17:39:34
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 115 ms / 5,000 ms
コード長 469 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 387 ms
コンパイル使用メモリ 20,824 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2026-03-28 21:48:15
合計ジャッジ時間 2,302 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# -*- 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