提出 #60985893


ソースコード 拡げる

{-# LANGUAGE BangPatterns #-}
import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.Maybe
import           Data.List
readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine
f :: Int -> Int -> Int -> String
f a b c
  | a == b && b == c = "Yes"
  | (sum [a, b, c]) == 2*(maximum [a, b, c]) = "Yes"
  | otherwise = "No"
main :: IO ()
main = do
    [a, b, c] <- getIntList
    putStrLn $ f a b c

提出情報

提出日時
問題 A - Equally
ユーザ suisankafe2
言語 Haskell (GHC 9.4.5)
得点 100
コード長 543 Byte
結果 AC
実行時間 2 ms
メモリ 6936 KiB

コンパイルエラー

app/Main.hs:2:1: warning: [-Wunused-imports]
    The import of ‘Control.Monad’ is redundant
      except perhaps to import instances from ‘Control.Monad’
    To import instances alone, use: import Control.Monad()
  |
2 | import           Control.Monad
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

app/Main.hs:5:1: warning: [-Wunused-imports]
    The import of ‘Data.List’ is redundant
      except perhaps to import instances from ‘Data.List’
    To import instances alone, use: import Data.List()
  |
5 | import           Data.List
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^

app/Main.hs:6:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature:
      readInt :: BS.ByteString -> Int
  |
6 | readInt = fst . fromJust . BS.readInt
  | ^^^^^^^

app/Main.hs:7:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature:
      readIntList :: BS.ByteString -> [Int]
  |
7 | readIntList = map readInt . BS.words
  | ^^^^^^^^^^^

app/Main.hs:8:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature: getInt :: IO Int
  |
8 | getInt = readInt <$> BS.getLine
  | ^^^^^^

app/Main.hs:8:1: warning: [-Wunused-top-binds]
    Defined but not used: ‘getInt’
  |
8 | getInt = readInt <$> BS.getLine
  | ^^^^^^

app/Main.hs:9:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature: getIntList :: IO [Int]
  |
9 | getIntList = readIntList <$> BS.getLine
  | ^^^^^^^^^^

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 3
AC × 18
セット名 テストケース
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.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, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt
ケース名 結果 実行時間 メモリ
00_sample_01.txt AC 1 ms 6896 KiB
00_sample_02.txt AC 2 ms 6924 KiB
00_sample_03.txt AC 1 ms 6856 KiB
01_random_01.txt AC 1 ms 6864 KiB
01_random_02.txt AC 1 ms 6936 KiB
01_random_03.txt AC 1 ms 6860 KiB
01_random_04.txt AC 1 ms 6864 KiB
01_random_05.txt AC 1 ms 6932 KiB
01_random_06.txt AC 1 ms 6892 KiB
01_random_07.txt AC 1 ms 6928 KiB
01_random_08.txt AC 1 ms 6652 KiB
01_random_09.txt AC 1 ms 6876 KiB
01_random_10.txt AC 1 ms 6864 KiB
01_random_11.txt AC 1 ms 6788 KiB
01_random_12.txt AC 1 ms 6772 KiB
01_random_13.txt AC 1 ms 6936 KiB
01_random_14.txt AC 1 ms 6888 KiB
01_random_15.txt AC 1 ms 6896 KiB