Submission #52861638
Source Code Expand
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE FlexibleContexts #-}
{-# HLINT ignore "Use lambda-case" #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
module Main where
import Control.Monad (replicateM)
import qualified Data.ByteString.Char8 as BC
import qualified Data.Char as C
import qualified Data.List as L
main :: IO ()
main = do
n <- readLn @Int
as <- replicateM n getLine
bs <- replicateM n getLine
let [(i', j')] = [(i + 1, j + 1) | (i, rowAs) <- zip [0 ..] as, (j, ca) <- zip [0 ..] rowAs, let cy = bs L.!! i L.!! j, ca /= cy]
putStrLn $ show i' ++ " " ++ show j'
readInputInts :: IO [Int]
readInputInts = L.unfoldr (BC.readInt . BC.dropWhile C.isSpace) <$> BC.getLine
Submission Info
| Submission Time | |
|---|---|
| Task | B - Spot the Difference |
| User | flowert |
| Language | Haskell (GHC 9.4.5) |
| Score | 150 |
| Code Size | 817 Byte |
| Status | AC |
| Exec Time | 4 ms |
| Memory | 9048 KiB |
Compile Error
app/Main.hs:22:7: warning: [-Wincomplete-uni-patterns]
Pattern match(es) are non-exhaustive
In a pattern binding:
Patterns of type ‘[(Int, Int)]’ not matched:
[]
((_, _):_:_)
|
22 | let [(i', j')] = [(i + 1, j + 1) | (i, rowAs) <- zip [0 ..] as, (j, ca) <- zip [0 ..] rowAs, let cy = bs L.!! i L.!! j, ca /= cy]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 150 / 150 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 6876 KiB |
| 00_sample_01.txt | AC | 1 ms | 6876 KiB |
| 00_sample_02.txt | AC | 1 ms | 7000 KiB |
| 01_random_00.txt | AC | 1 ms | 6712 KiB |
| 01_random_01.txt | AC | 3 ms | 8788 KiB |
| 01_random_02.txt | AC | 4 ms | 8912 KiB |
| 01_random_03.txt | AC | 1 ms | 6976 KiB |
| 01_random_04.txt | AC | 4 ms | 9048 KiB |
| 01_random_05.txt | AC | 2 ms | 7548 KiB |
| 01_random_06.txt | AC | 4 ms | 8952 KiB |
| 01_random_07.txt | AC | 3 ms | 8176 KiB |