Submission #75260240


Source Code Expand

{-# OPTIONS_GHC -Wall #-}
{-# OPTIONS_GHC -Wname-shadowing #-} -- 内側のスコープの値と同じ名前が外側のスコープにあるとき警告する

import Control.Monad
import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List -- nub O(n^2)

readInts :: IO [Int]
readInts = unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
readDoubles :: IO [Double]
readDoubles = map read . words . BS.unpack <$> BS.getLine

main :: IO ()
main = do
  [h,w] <- readInts
  ss <- replicateM h getLine
  let cands = map f [[[ ss !! x !! y | x <- [i..k]] | y <- [j..l]] | i <- [0..h-1], j <- [0..w-1], k <- [i..h-1], l <- [j..w-1]]
  print $ length $ filter id cands

f ss = ss == (reverse $ map reverse ss)

Submission Info

Submission Time
Task B - Spiral Galaxy
User haskboy
Language Haskell (GHC 9.8.4)
Score 200
Code Size 752 Byte
Status AC
Exec Time 12 ms
Memory 12648 KiB

Compile Error

Configuration is affected by the following files:
- cabal.project
- cabal.project.freeze
- cabal.project.local

app/Main.hs:12:1: warning: [GHC-40910] [-Wunused-top-binds]
    Defined but not used: ‘readDoubles’
   |
12 | readDoubles = map read . words . BS.unpack <$> BS.getLine
   | ^^^^^^^^^^^

app/Main.hs:21:1: warning: [GHC-38417] [-Wmissing-signatures]
    Top-level binding with no type signature:
      f :: Eq a => [[a]] -> Bool
   |
21 | f ss = ss == (reverse $ map reverse ss)
   | ^
Configuration is affected by the following files:
- cabal.project
- cabal.project.freeze
- cabal.project.local

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 13
Set Name Test Cases
Sample sample00.txt, sample01.txt
All sample00.txt, sample01.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt
Case Name Status Exec Time Memory
sample00.txt AC 12 ms 8208 KiB
sample01.txt AC 3 ms 8500 KiB
testcase00.txt AC 3 ms 8196 KiB
testcase01.txt AC 4 ms 10068 KiB
testcase02.txt AC 5 ms 12500 KiB
testcase03.txt AC 3 ms 8432 KiB
testcase04.txt AC 5 ms 12292 KiB
testcase05.txt AC 3 ms 9580 KiB
testcase06.txt AC 5 ms 12332 KiB
testcase07.txt AC 4 ms 10192 KiB
testcase08.txt AC 6 ms 12400 KiB
testcase09.txt AC 7 ms 12416 KiB
testcase10.txt AC 6 ms 12648 KiB