結果

問題 No.998 Four Integers
コンテスト
ユーザー ikd
提出日時 2020-05-01 18:21:15
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 44 ms / 1,000 ms
コード長 444 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 13,951 ms
コンパイル使用メモリ 220,484 KB
実行使用メモリ 32,512 KB
最終ジャッジ日時 2026-05-30 09:10:24
合計ジャッジ時間 15,654 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (231 ミリ秒)。
/home/judge/data/code/Main.fs(8,9): warning FS0025: この式のパターン マッチが不完全です たとえば、値 '[|_; _; _; _; _|]' はパターンに含まれないケースを示す可能性があります。 [/home/judge/data/code/main.fsproj]
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

// Learn more about F# at http://fsharp.org

open System

[<EntryPoint>]
let main argv =
    // https://docs.microsoft.com/ja-jp/dotnet/fsharp/language-reference/pattern-matching#array-pattern
    let [|a; b; c; d|] = 
        stdin.ReadLine().Split() 
        |> Array.map int 
        |> Array.sortBy(id)
    if a + 1 = b && b + 1 = c && c + 1 = d then
        printfn "Yes"
    else
        printfn "No"
    0 // return an integer exit code
0