結果

問題 No.780 オフ会
ユーザー taktak
提出日時 2019-02-02 06:28:14
言語 F#
(F# 4.0)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 4,980 ms
コンパイル使用メモリ 167,760 KB
実行使用メモリ 25,016 KB
最終ジャッジ日時 2023-08-16 13:51:05
合計ジャッジ時間 8,805 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
23,008 KB
testcase_01 AC 83 ms
20,860 KB
testcase_02 AC 82 ms
22,908 KB
testcase_03 AC 83 ms
24,936 KB
testcase_04 AC 83 ms
24,952 KB
testcase_05 AC 83 ms
24,996 KB
testcase_06 AC 83 ms
22,976 KB
testcase_07 AC 83 ms
23,056 KB
testcase_08 AC 82 ms
25,016 KB
testcase_09 AC 83 ms
22,944 KB
testcase_10 AC 82 ms
22,988 KB
testcase_11 AC 82 ms
22,904 KB
testcase_12 AC 83 ms
22,880 KB
testcase_13 AC 82 ms
20,988 KB
testcase_14 AC 83 ms
23,000 KB
testcase_15 AC 83 ms
22,996 KB
testcase_16 AC 86 ms
24,980 KB
testcase_17 AC 85 ms
24,996 KB
testcase_18 AC 85 ms
23,088 KB
testcase_19 AC 83 ms
20,848 KB
testcase_20 AC 83 ms
23,028 KB
testcase_21 AC 83 ms
22,976 KB
testcase_22 AC 83 ms
22,904 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

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