結果
| 問題 | No.18 うーさー暗号 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-09-11 22:15:05 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 82 ms / 5,000 ms |
| コード長 | 309 bytes |
| 記録 | |
| コンパイル時間 | 123 ms |
| コンパイル使用メモリ | 77,464 KB |
| 最終ジャッジ日時 | 2025-12-03 16:53:45 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
ソースコード
st = list(raw_input())
al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
enc = dict(zip(al, range(26)))
dec = dict(zip(range(26), al))
ans = []
i = 0
for s in st:
digit = enc[s] - ((i + 1) % 26)
if digit < 0:
ans.append(dec[digit + 26])
else:
ans.append(dec[digit])
i += 1
print ''.join(ans)