結果
| 問題 |
No.779 Heisei
|
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2019-02-23 00:48:37 |
| 言語 | F# (F# 4.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 771 bytes |
| コンパイル時間 | 15,613 ms |
| コンパイル使用メモリ | 186,760 KB |
| 最終ジャッジ日時 | 2024-11-14 21:16:09 |
| 合計ジャッジ時間 | 16,095 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (403 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) /home/judge/data/code/Main.fs(26,12): error FS0041: このプログラム ポイントよりも前の型情報に基づいて、メソッド 'DateTime' の固有のオーバーロードを決定することができませんでした。型の注釈が必要な場合があります。既知の型の引数: 'a * 'b * 'c when 'a: (static member Parse: string -> 'a) and 'b: (static member Parse: string -> 'b) and 'c: (static member Parse: string -> 'c)候補: - DateTime(date: DateOnly, time: TimeOnly, kind: DateTimeKind) : DateTime - DateTime(year: int, month: int, day: int) : DateTime [/home/judge/data/code/main.fsproj]
ソースコード
open System
open System.IO
let readStr () =
Seq.initInfinite <| fun _ -> Console.Read ()
|> Seq.skipWhile (fun c ->
if c = -1 then raise <| EndOfStreamException ()
else char c |> Char.IsWhiteSpace)
|> Seq.takeWhile (fun c -> c <> -1 && char c |> Char.IsWhiteSpace |> not)
|> Seq.map char
|> Seq.toArray
|> fun cs -> new string (cs)
let inline read () =
(^a : (static member Parse : string -> ^a) readStr ())
open System.Globalization
let calender = JapaneseCalendar ()
let endOfHeisei = DateTime (2019, 4, 30)
let y = read ()
let m = read ()
let d = read ()
let date = DateTime (y, m, d)
let ans = if calender.GetEra date = 4 && date <= endOfHeisei then "Yes" else "No"
Console.WriteLine ans
くれちー