結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-26 01:18:20 |
| 言語 | F# (F# 4.0) |
| 結果 |
AC
|
| 実行時間 | 350 ms / 1,000 ms |
| コード長 | 407 bytes |
| コンパイル時間 | 6,782 ms |
| コンパイル使用メモリ | 185,960 KB |
| 実行使用メモリ | 35,704 KB |
| 最終ジャッジ日時 | 2024-11-14 13:24:56 |
| 合計ジャッジ時間 | 10,101 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (233 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/
ソースコード
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"