結果
| 問題 |
No.26 シャッフルゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-01 09:02:50 |
| 言語 | Haskell (9.10.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 432 bytes |
| コンパイル時間 | 1,869 ms |
| コンパイル使用メモリ | 170,240 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-02 08:45:19 |
| 合計ジャッジ時間 | 2,446 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 3 |
コンパイルメッセージ
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:11:1: warning: [GHC-94817] [-Wtabs]
Tab character found here, and in three further locations.
Suggested fix: Please use spaces instead.
|
11 | n <- readLn
| ^^^^^^^^
[2 of 2] Linking a.out
ソースコード
chg :: [Int] -> (Int,Int) -> [Int] chg (a:b:c:[]) (1,2) = b : a : c : [] chg (a:b:c:[]) (2,1) = b : a : c : [] chg (a:b:c:[]) (2,3) = a : c : b : [] chg (a:b:c:[]) (3,2) = a : c : b : [] chg (a:b:c:[]) (1,3) = c : b : a : [] chg (a:b:c:[]) (3,1) = c : b : a : [] chg _ _ = [] main = do n <- readLn getLine c <- getContents >>= return . map ((\(a:b:[]) -> (read a,read b)) . words) . lines print $ (foldl chg [1,2,3] c) !! (n-1)