結果
問題 | No.188 HAPPY DAY |
ユーザー |
|
提出日時 | 2017-04-12 10:55:28 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 906 bytes |
コンパイル時間 | 4,193 ms |
コンパイル使用メモリ | 174,772 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-31 01:31:06 |
合計ジャッジ時間 | 4,768 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
calendar2015::IntIntcalendar2015 = [(1,31), (2,28), (3,31), (4,30), (5,31), (6,30), (7,31), (8,31), (9,30), (10,31), (11,30), (12,31)]happyDay::Int->Int->BoolhappyDay m d| m == d_10 + d_01 = True| otherwise = Falsewhered_10 = floor $ (fromIntegral (d :: Int)) / 10.0d_01 = d - d_10 * 10happyDayCounter::IntInt->InthappyDayCounter [] = 0happyDayCounter (c:cs) =doletm = fst cd = snd cdays = [1..d]happyDayCounter' m days + happyDayCounter cswherehappyDayCounter'::Int->Int->InthappyDayCounter' _ [] = 0happyDayCounter' m (d:ds) -- = cnt + happyDayCounter' m ds| happyDay m d == True = happyDayCounter' m ds + 1| otherwise = happyDayCounter' m dsmain = print $ happyDayCounter calendar2015