結果

問題 No.185 和風
ユーザー Nobita GomuNobita Gomu
提出日時 2017-09-26 01:18:20
言語 F#
(F# 4.0)
結果
AC  
実行時間 99 ms / 1,000 ms
コード長 407 bytes
コンパイル時間 3,529 ms
コンパイル使用メモリ 158,452 KB
実行使用メモリ 27,164 KB
最終ジャッジ日時 2023-08-09 07:06:02
合計ジャッジ時間 4,765 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
22,980 KB
testcase_01 AC 97 ms
24,968 KB
testcase_02 AC 96 ms
24,960 KB
testcase_03 AC 99 ms
27,164 KB
testcase_04 AC 97 ms
26,988 KB
testcase_05 AC 96 ms
25,024 KB
testcase_06 AC 97 ms
25,036 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let split (s:string) = s.Split ' '

let subtract = split >> Array.map int >> fun (a:int[]) -> a.[1] - a.[0]
let judge (a:int[]) =
    match a with
    | a when Array.length a = 1 && a.[0] > 0 -> a.[0]
    | _ -> -1

let iter (n:int) =
    seq { for _ in 1..n -> stdin.ReadLine () }
    |> Seq.map subtract
    |> Seq.distinct
    |> Seq.toArray
    |> judge

stdin.ReadLine () |> int |> iter |> printfn "%d"
0