結果
| 問題 | No.18 うーさー暗号 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-25 18:19:19 |
| 言語 | Haskell (9.14.1) |
| 結果 |
AC
|
| 実行時間 | 85 ms / 5,000 ms |
| コード長 | 286 bytes |
| 記録 | |
| コンパイル時間 | 9,468 ms |
| コンパイル使用メモリ | 189,312 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-17 08:55:47 |
| 合計ジャッジ時間 | 11,343 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Data.Char (ord)
chars = cycle ['A' .. 'Z']
encode = map (subtract (ord 'A') . ord)
decode = map (chars !!)
usa s = decode $ zipWith (\n c -> f (c - n)) [1 ..] $ encode s
where
f a
| a < 0 = (26 * 1024) + a
| otherwise = a
main = getLine >>= putStrLn . usa