結果
問題 | No.188 HAPPY DAY |
ユーザー | OldBrid21501053 |
提出日時 | 2019-09-12 15:15:24 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 124 ms / 1,000 ms |
コード長 | 541 bytes |
コンパイル時間 | 3,288 ms |
コンパイル使用メモリ | 162,788 KB |
実行使用メモリ | 23,944 KB |
最終ジャッジ日時 | 2023-09-15 14:13:12 |
合計ジャッジ時間 | 3,996 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
(要ログイン)
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0 Copyright (c) Microsoft Corporation. All Rights Reserved.
ソースコード
open System open System.IO let solve() = let dt = DateTime.Parse("2015/01/01") let rec countHappyDay (DT:DateTime) (c:int) = let m = DT.Month let d = DT.Day if m = 12 && d = 31 then c else let l, h = d % 10, (d / 10) % 10 let DT = DT.AddDays(1.) if l + h = m then countHappyDay DT (c+1) else countHappyDay DT c countHappyDay dt 0 |> printfn "%d" [<EntryPoint>] let main argv = solve() 0