結果

問題 No.488 四角関係
ユーザー aimyaimy
提出日時 2017-06-24 17:16:20
言語 Haskell
(9.6.2)
結果
TLE  
実行時間 -
コード長 402 bytes
コンパイル時間 1,801 ms
コンパイル使用メモリ 160,680 KB
実行使用メモリ 11,460 KB
最終ジャッジ日時 2023-07-27 09:59:11
合計ジャッジ時間 28,482 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,121 ms
11,456 KB
testcase_01 AC 4,622 ms
11,460 KB
testcase_02 AC 4,912 ms
11,388 KB
testcase_03 AC 1,242 ms
11,380 KB
testcase_04 AC 2,623 ms
11,408 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.List
import Control.Monad

main = do
 [n,_] <- map read . words <$> getLine
 abs <- map (map read . words) . lines <$> getContents
 print (shikaku n abs)

shikaku n abs = length $ do
 v1 <- [0 .. n-1]
 v2 <- [v1+1 .. n-1]
 v3 <- [v2+1 .. n-1]
 v4 <- [v3+1 .. n-1]
 let cand = filter (\ab -> intersect ab [v1,v2,v3,v4] == ab) abs
 guard $ map length (group (sort (concat cand))) == [2,2,2,2]
0