結果

問題 No.779 Heisei
ユーザー torus711torus711
提出日時 2019-01-26 14:00:51
言語 Haskell
(9.8.2)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 951 bytes
コンパイル時間 7,299 ms
コンパイル使用メモリ 160,552 KB
実行使用メモリ 7,348 KB
最終ジャッジ日時 2023-08-06 00:06:45
合計ジャッジ時間 8,416 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,220 KB
testcase_01 AC 2 ms
7,136 KB
testcase_02 AC 2 ms
7,200 KB
testcase_03 AC 2 ms
7,184 KB
testcase_04 AC 3 ms
7,296 KB
testcase_05 AC 2 ms
7,124 KB
testcase_06 AC 2 ms
7,264 KB
testcase_07 AC 2 ms
7,176 KB
testcase_08 AC 2 ms
7,164 KB
testcase_09 AC 2 ms
7,204 KB
testcase_10 AC 2 ms
7,188 KB
testcase_11 AC 3 ms
7,184 KB
testcase_12 AC 2 ms
7,328 KB
testcase_13 AC 2 ms
7,224 KB
testcase_14 AC 3 ms
7,184 KB
testcase_15 AC 2 ms
7,192 KB
testcase_16 AC 2 ms
7,176 KB
testcase_17 AC 3 ms
7,136 KB
testcase_18 AC 2 ms
7,176 KB
testcase_19 AC 2 ms
7,224 KB
testcase_20 AC 3 ms
7,164 KB
testcase_21 AC 2 ms
7,348 KB
testcase_22 AC 2 ms
7,296 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )

Main.hs:35:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in 8 further locations.
    Suggested fix: Please use spaces instead.
   |
35 |         [ y, m, d ] <- readInts
   | ^^^^^^^^
[2 of 2] Linking a.out

ソースコード

diff #

{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

import Data.Time.Calendar

readInt = readLn :: IO Int
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readNInts = readInt >>= flip replicateM readInt

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	[ y, m, d ] <- readInts
	let
		heisei_begin = fromGregorian 1989 1 8
		heisei_end = fromGregorian 2019 4 30
		now = fromGregorian ( fromIntegral y ) m d
	putStrLn $ which "Yes" "No" $ 0 <= diffDays now heisei_begin && 0 <= diffDays heisei_end now
0