Submission #28398


Source Code Expand

import Data.List

main=do
  [n,k] <- fmap (map read . words) getLine
  boats <- mapM (\_ -> fmap (map read . tail . words) getLine) [1..k]
  r <- fmap read getLine
  pairs <- mapM (\_ -> fmap (map read . words) getLine) [1..r]
  print $ f boats pairs

f :: [[Int]]->[[Int]]->Int
f boats pairs = length $ nub $ concat[p|p<-pairs,b<-boats,all(`elem`b)p]

Submission Info

Submission Time
Task C - ソーシャル
User notogawa
Language Haskell (GHC 7.4.1)
Score 100
Code Size 363 Byte
Status AC
Exec Time 50 ms
Memory 2488 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 39
Set Name Test Cases
All 00_sample_01, 00_sample_02, 00_sample_03, 10_random_0, 10_random_1, 10_random_10, 10_random_11, 10_random_12, 10_random_13, 10_random_14, 10_random_15, 10_random_16, 10_random_17, 10_random_18, 10_random_19, 10_random_2, 10_random_20, 10_random_21, 10_random_22, 10_random_23, 10_random_24, 10_random_25, 10_random_26, 10_random_27, 10_random_28, 10_random_3, 10_random_4, 10_random_5, 10_random_6, 10_random_7, 10_random_8, 10_random_9, 20_twopartition_0, 20_twopartition_1, 20_twopartition_2, 20_twopartition_3, 20_twopartition_4, 20_twopartition_5, 20_twopartition_6
Case Name Status Exec Time Memory
00_sample_01 AC 42 ms 1340 KB
00_sample_02 AC 25 ms 1396 KB
00_sample_03 AC 26 ms 1464 KB
10_random_0 AC 25 ms 1324 KB
10_random_1 AC 26 ms 1340 KB
10_random_10 AC 26 ms 1300 KB
10_random_11 AC 26 ms 1332 KB
10_random_12 AC 27 ms 1464 KB
10_random_13 AC 25 ms 1468 KB
10_random_14 AC 28 ms 1848 KB
10_random_15 AC 28 ms 1844 KB
10_random_16 AC 31 ms 1840 KB
10_random_17 AC 31 ms 1844 KB
10_random_18 AC 33 ms 1972 KB
10_random_19 AC 30 ms 1848 KB
10_random_2 AC 28 ms 1340 KB
10_random_20 AC 28 ms 1852 KB
10_random_21 AC 30 ms 1844 KB
10_random_22 AC 31 ms 1916 KB
10_random_23 AC 32 ms 1976 KB
10_random_24 AC 28 ms 1844 KB
10_random_25 AC 29 ms 1776 KB
10_random_26 AC 30 ms 1848 KB
10_random_27 AC 31 ms 1844 KB
10_random_28 AC 32 ms 2012 KB
10_random_3 AC 26 ms 1424 KB
10_random_4 AC 49 ms 2360 KB
10_random_5 AC 25 ms 1432 KB
10_random_6 AC 26 ms 1592 KB
10_random_7 AC 50 ms 2488 KB
10_random_8 AC 25 ms 1336 KB
10_random_9 AC 27 ms 1340 KB
20_twopartition_0 AC 34 ms 1980 KB
20_twopartition_1 AC 33 ms 1976 KB
20_twopartition_2 AC 33 ms 1988 KB
20_twopartition_3 AC 34 ms 1980 KB
20_twopartition_4 AC 33 ms 1980 KB
20_twopartition_5 AC 28 ms 1468 KB
20_twopartition_6 AC 27 ms 1464 KB