結果

問題 No.18 うーさー暗号
ユーザー くじらごりらくじらごりら
提出日時 2022-10-20 10:56:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 260 bytes
コンパイル時間 722 ms
コンパイル使用メモリ 10,588 KB
実行使用メモリ 9,132 KB
最終ジャッジ日時 2023-09-12 17:07:20
合計ジャッジ時間 1,821 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
8,980 KB
testcase_01 AC 24 ms
9,132 KB
testcase_02 AC 24 ms
9,084 KB
testcase_03 AC 25 ms
9,080 KB
testcase_04 AC 25 ms
8,984 KB
testcase_05 AC 25 ms
8,988 KB
testcase_06 AC 26 ms
9,084 KB
testcase_07 AC 26 ms
8,900 KB
testcase_08 AC 25 ms
9,128 KB
testcase_09 AC 25 ms
9,116 KB
testcase_10 AC 25 ms
9,040 KB
testcase_11 AC 24 ms
8,984 KB
testcase_12 AC 26 ms
9,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import string 

alpha = list(string.ascii_uppercase)

S = input()
ans =''

for i,s  in enumerate(S):
    i=i+1
    if i > 26:
        i = i % 26
    f=alpha.index(s)
    if f - i >= 0:
        ans += alpha[f-i]
    else:
        ans += alpha[f-i+26]
print(ans)
0