結果
問題 |
No.18 うーさー暗号
|
ユーザー |
|
提出日時 | 2015-04-22 22:28:12 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 287 bytes |
コンパイル時間 | 2,028 ms |
コンパイル使用メモリ | 174,464 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 00:20:19 |
合計ジャッジ時間 | 2,741 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 11 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) Main.hs:6:1: warning: [GHC-94817] [-Wtabs] Tab character found here, and in six further locations. Suggested fix: Please use spaces instead. | 6 | where | ^^^^^^^^ [2 of 2] Linking a.out
ソースコード
import Data.Char main = getLine >>= putStrLn . solve solve :: String -> String solve xs = fst $ foldr ff ([], m) xs where m = length xs ff x (acc, n) | ord x - n < ord 'A' = ((chr $ ord 'Z' - ord x + n - 1 + ord 'A') : acc, n - 1) | otherwise = ((chr $ ord x - n) : acc, n - 1)