結果

問題 No.780 オフ会
ユーザー tak
提出日時 2019-02-02 06:28:14
言語 F#
(F# 4.0)
結果
AC  
実行時間 327 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 10,409 ms
コンパイル使用メモリ 189,244 KB
実行使用メモリ 34,900 KB
最終ジャッジ日時 2024-11-25 03:04:53
合計ジャッジ時間 18,708 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (270 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

open System

type Boy = int
type Girl = int
type Student = { Boy: Boy; Girl: Girl }

let (|Pair|Alone|) x = 
    if x.Boy <= x.Girl then Pair
    else Alone

let solve x = 
    let yasuo = x |> function | Pair -> "YES" | Alone -> "NO"
    let left = abs <| x.Boy - x.Girl
    (yasuo, left)

let A, B = let t = stdin.ReadLine().Split() |> Array.map int in t.[0], t.[1]

solve { Boy = A + 1; Girl = B }
|> fun res -> printfn "%s\n%i" (fst res) (snd res)
0