Submission #676399


Source Code Expand

import Control.Monad

main :: IO()
main = do
  [n, q] <- (map read) . words <$> getLine
  commands <- replicateM q $ (map read) . words <$> getLine
  putStrLn $ rev (take n (repeat '0')) commands

rev :: String -> [[Int]] -> String
rev board [] = board
rev board com =
    rev (fst ++ (map (\c -> if c == '0' then '1' else '0') snd) ++ trd) (tail com)
    where l = (head com) !! 0
          r = (head com) !! 1
          (fst, tmp) = splitAt (l - 1) board
          (snd, trd) = splitAt (r - l + 1) tmp

Submission Info

Submission Time
Task C - オセロ
User aruneko99
Language Haskell (GHC 7.10.3)
Score 60
Code Size 518 Byte
Status TLE
Exec Time 2122 ms
Memory 184700 KiB

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 60 / 60 0 / 40
Status
AC × 2
AC × 12
AC × 13
TLE × 21
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
Subtask1 00_example_01.txt, 00_example_02.txt, 10_small_01.txt, 10_small_02.txt, 10_small_03.txt, 10_small_04.txt, 10_small_05.txt, 10_small_06.txt, 10_small_07.txt, 10_small_08.txt, 10_small_09.txt, 10_small_10.txt
All 00_example_01.txt, 00_example_02.txt, 10_small_01.txt, 10_small_02.txt, 10_small_03.txt, 10_small_04.txt, 10_small_05.txt, 10_small_06.txt, 10_small_07.txt, 10_small_08.txt, 10_small_09.txt, 10_small_10.txt, 20_rand_01.txt, 20_rand_02.txt, 20_rand_03.txt, 20_rand_04.txt, 20_rand_05.txt, 20_rand_06.txt, 20_rand_07.txt, 20_rand_08.txt, 20_rand_09.txt, 20_rand_10.txt, 30_max_01.txt, 30_max_02.txt, 30_max_03.txt, 30_max_04.txt, 30_max_05.txt, 40_corner_01.txt, 40_corner_02.txt, 40_corner_03.txt, 40_corner_04.txt, 40_corner_05.txt, 40_corner_06.txt, 40_corner_07.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 5 ms 508 KiB
00_example_02.txt AC 5 ms 508 KiB
10_small_01.txt AC 38 ms 2428 KiB
10_small_02.txt AC 10 ms 1148 KiB
10_small_03.txt AC 5 ms 764 KiB
10_small_04.txt AC 22 ms 2044 KiB
10_small_05.txt AC 9 ms 1020 KiB
10_small_06.txt AC 23 ms 2044 KiB
10_small_07.txt AC 7 ms 1020 KiB
10_small_08.txt AC 5 ms 508 KiB
10_small_09.txt AC 10 ms 1148 KiB
10_small_10.txt AC 8 ms 1020 KiB
20_rand_01.txt TLE 2120 ms 153980 KiB
20_rand_02.txt TLE 2109 ms 39292 KiB
20_rand_03.txt TLE 2105 ms 3452 KiB
20_rand_04.txt TLE 2114 ms 93564 KiB
20_rand_05.txt TLE 2109 ms 40316 KiB
20_rand_06.txt TLE 2109 ms 85372 KiB
20_rand_07.txt TLE 2106 ms 6524 KiB
20_rand_08.txt AC 781 ms 2684 KiB
20_rand_09.txt TLE 2110 ms 57724 KiB
20_rand_10.txt TLE 2104 ms 24956 KiB
30_max_01.txt TLE 2122 ms 168316 KiB
30_max_02.txt TLE 2121 ms 169340 KiB
30_max_03.txt TLE 2117 ms 170364 KiB
30_max_04.txt TLE 2121 ms 167292 KiB
30_max_05.txt TLE 2121 ms 168316 KiB
40_corner_01.txt TLE 2110 ms 75132 KiB
40_corner_02.txt TLE 2118 ms 137596 KiB
40_corner_03.txt TLE 2117 ms 164220 KiB
40_corner_04.txt TLE 2122 ms 184700 KiB
40_corner_05.txt TLE 2112 ms 114044 KiB
40_corner_06.txt TLE 2111 ms 75132 KiB
40_corner_07.txt TLE 2118 ms 137596 KiB