結果

問題 No.179 塗り分け
ユーザー aimyaimy
提出日時 2017-05-01 17:03:39
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 5,076 ms
コンパイル使用メモリ 175,360 KB
実行使用メモリ 14,880 KB
最終ジャッジ日時 2024-04-14 06:24:20
合計ジャッジ時間 15,071 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
14,880 KB
testcase_01 AC 1 ms
6,812 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2,300 ms
8,576 KB
testcase_11 AC 1,859 ms
8,320 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

ソースコード

diff #

import Data.Char
import Data.Bool
import Data.List
import Control.Monad

main = do
 [h,w] <- map read . words <$> getLine
 is <- map (\i -> i + (div i w * w)) . findIndices (=='#') . filter isPrint <$> getContents
 putStrLn $ bool "NO" "YES" (dpaint h w is)

dpaint h w is
 | odd (length is) = False
 | otherwise = or $ do
  d <- [1 .. (h*w-1)]
  let is' = map (+d) is
  let inter = intersect is is'
  let inter' = map (subtract d) inter
  return (sort (inter++inter') == is)
0