結果
| 問題 | No.483 マッチ並べ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-11 00:35:40 |
| 言語 | F# (F# 10.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,461 bytes |
| 記録 | |
| コンパイル時間 | 7,487 ms |
| コンパイル使用メモリ | 225,092 KB |
| 実行使用メモリ | 288,232 KB |
| 最終ジャッジ日時 | 2026-06-03 06:17:06 |
| 合計ジャッジ時間 | 13,831 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 TLE * 1 -- * 25 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (217 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
let solve rc_lst =
let rec solve' lst (result: Set<int * int> list) =
//eprintfn "%A" result
match lst with
| [] -> true
| x::xs ->
let r0, c0, r1, c1 = x
let result = match result with
| [] -> [set[(r0, c0)]; set[(r1, c1)]]
| _ ->
result
|> List.map (fun s ->
match (Set.contains (r0, c0) s), (Set.contains (r1, c1) s) with
| true, true -> []
| false, true -> [(Set.add (r0, c0) s)]
| true, false -> [(Set.add (r1, c1) s)]
| false, false -> [(Set.add (r0, c0) s); (Set.add (r1, c1) s)])
|> List.concat
if result = [] then false
else solve' xs result
solve' rc_lst []
let () =
let n = stdin.ReadLine() |> int
let rc_lst =
seq {
for _ in 1..n do
let r0, c0, r1, c1 = stdin.ReadLine()
|> fun s -> s.Split()
|> Array.map int
|> fun arr -> arr.[0], arr.[1], arr.[2], arr.[3]
yield (r0, c0, r1, c1) }
|> List.ofSeq
solve rc_lst
|> function | true -> "YES" | false -> "NO"
|> printfn "%s"