結果
| 問題 | No.998 Four Integers |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-17 23:20:41 |
| 言語 | OCaml (5.5.2) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 1,000 ms |
| + 739µs | |
| コード長 | 493 bytes |
| 記録 | |
| コンパイル時間 | 272 ms |
| コンパイル使用メモリ | 22,820 KB |
| 実行使用メモリ | 9,904 KB |
| 最終ジャッジ日時 | 2026-11-12 01:27:25 |
| 合計ジャッジ時間 | 2,111 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
コンパイルメッセージ
ocamlfind: [WARNING] Cannot read directory ./stublibs which is mentioned in ld.conf
ソースコード
let solve a b c d =
let lst = [ a; b; c; d; ] |> List.sort ( - ) in
let rec solve' cur left_lst =
match left_lst with
| x :: xs ->
if x - cur <> 1 then
"No"
else
solve' x xs
| _ -> "Yes"
in
solve' (List.hd lst) (List.tl lst)
let () =
let a, b, c, d =
read_line ()
|> fun l -> Scanf.sscanf l "%d %d %d %d" (fun a b c d -> (a, b, c, d))
in
print_endline @@ solve a b c d