結果
問題 | No.601 Midpoint Erase |
ユーザー |
![]() |
提出日時 | 2017-12-01 23:17:44 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 159 ms / 2,000 ms |
コード長 | 695 bytes |
コンパイル時間 | 6,500 ms |
コンパイル使用メモリ | 180,308 KB |
実行使用メモリ | 50,816 KB |
最終ジャッジ日時 | 2024-12-23 03:24:14 |
合計ジャッジ時間 | 8,538 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
LANGUAGEimportControl.ApplicativeimportControl.MonadimportqualifiedData.ByteString.CharasBimportData.MaybefromJustimportText.PrintfimportDebug.Tracecount xs a = length $ filter (==a) xsmain = do[n] <- getIntsxs <- map (map (`mod` 2)) <$> replicateM n getIntslet win = (count xs [0,0] `div` 2) + (count xs [0,1] `div` 2) + (count xs [1,0] `div` 2) + (count xs [1,1] `div` 2)putStrLn $ if win `mod` 2 == 0 then "Bob" else "Alice"-- utilgetInts::IOIntgetInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLinesubstr::Int->Int->BByteString->BByteStringsubstr b l s = B.take l $ B.drop b s