結果
| 問題 | No.197 手品 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-01 07:19:28 |
| 言語 | Haskell (9.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 696 bytes |
| 記録 | |
| コンパイル時間 | 7,511 ms |
| コンパイル使用メモリ | 195,328 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-15 11:15:46 |
| 合計ジャッジ時間 | 8,671 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 41 WA * 2 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/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 40 further locations.
Suggested fix: Please use spaces instead.
|
6 | bef <- sum . zipWith (*) (iterate (*2) 1) . map convert <$> getLine
| ^^^^^^^^
[2 of 2] Linking a.out
ソースコード
import Control.Applicative import Data.Bits main :: IO() main = do bef <- sum . zipWith (*) (iterate (*2) 1) . map convert <$> getLine n <- readLn aft <-sum . zipWith (*) (iterate (*2) 1) . map convert <$> getLine let nb = popCount bef let na = popCount aft putStrLn $ if nb /= na then "SUCCESS" else if bef == 0 || bef == 7 then "FAILURE" else case n of 0 -> if bef == aft then "Failure" else "Success" 1 | isLat bef && (bef == aft || isCen aft) -> "FAILURE" | isCen bef && isLat aft -> "FAILURE" | otherwise -> "SUCCESS" _ -> "FAILURE" isLat x = elem x [1,3,4,6] isCen x = elem x [2,5] convert :: Char -> Int convert x | x == 'o' = 0 | x == 'x' = 1