結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
r6eve
|
| 提出日時 | 2017-08-11 09:57:45 |
| 言語 | OCaml (5.2.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 332 bytes |
| コンパイル時間 | 381 ms |
| コンパイル使用メモリ | 21,444 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 00:11:28 |
| 合計ジャッジ時間 | 754 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 1 |
ソースコード
let () =
let n = Scanf.scanf "%d " (fun i -> i) in
let rec doit i z =
if i = n then z
else
let x, y = Scanf.scanf "%d %d " (fun x y -> x, y) in
if x > y then (-1)
else
let s = y - x in
if z <> (-1) && z <> s then (-1)
else doit (i + 1) s in
doit 0 (-1) |> Printf.printf "%d\n"
r6eve