結果

問題 No.870 無敵囲い
ユーザー guriceringuricerin
提出日時 2020-01-10 14:02:29
言語 F#
(F# 4.0)
結果
AC  
実行時間 62 ms / 300 ms
コード長 1,167 bytes
コンパイル時間 5,873 ms
コンパイル使用メモリ 166,432 KB
実行使用メモリ 24,496 KB
最終ジャッジ日時 2023-09-11 16:29:18
合計ジャッジ時間 7,980 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
24,320 KB
testcase_01 AC 61 ms
22,500 KB
testcase_02 AC 62 ms
22,496 KB
testcase_03 AC 62 ms
24,396 KB
testcase_04 AC 60 ms
22,332 KB
testcase_05 AC 61 ms
22,396 KB
testcase_06 AC 61 ms
22,272 KB
testcase_07 AC 61 ms
22,360 KB
testcase_08 AC 61 ms
24,348 KB
testcase_09 AC 60 ms
22,456 KB
testcase_10 AC 61 ms
22,328 KB
testcase_11 AC 61 ms
22,268 KB
testcase_12 AC 61 ms
22,412 KB
testcase_13 AC 61 ms
20,308 KB
testcase_14 AC 61 ms
22,336 KB
testcase_15 AC 62 ms
22,328 KB
testcase_16 AC 61 ms
24,376 KB
testcase_17 AC 61 ms
22,236 KB
testcase_18 AC 61 ms
24,496 KB
testcase_19 AC 61 ms
22,404 KB
testcase_20 AC 61 ms
22,476 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

/home/judge/data/code/Main.fs(24,13): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _; _; _|]' may indicate a case not covered by the pattern(s).

ソースコード

diff #

open System
open System.Collections.Generic

[<AutoOpen>]
module Cin =
    let read f = stdin.ReadLine() |> f
    let reada f = stdin.ReadLine().Split() |> Array.map f
    let readChars() = read string |> Seq.toArray
    let readInts() = readChars() |> Array.map (fun x -> Convert.ToInt32(x.ToString()))

[<AutoOpen>]
module Cout =
    let writer = new IO.StreamWriter(new IO.BufferedStream(Console.OpenStandardOutput()))
    let print (s: string) = writer.Write s
    let println (s: string) = writer.WriteLine s
    let inline puts (s: ^a) = string s |> println

let solve() =
    let n = read int
    let mutable a = (2, 8)
    let mutable b = (3, 9)
    let mutable c = (7, 9)
    for _ in 0 .. n - 1 do
        let [| x1; y1; x2; y2 |] = reada int
        match (x1, y1) with
        | n when n = a -> a <- (x2, y2)
        | n when n = b -> b <- (x2, y2)
        | n when n = c -> c <- (x2, y2)
        | _ -> ()

    match a, b, c with
    | (5, 8), (4, 8), (6, 8) -> "YES"
    | _ -> "NO"
    |> puts
    ()

[<EntryPoint>]
let main _ =
    try
        solve()
    with e -> printfn "%s" (e.ToString())
    writer.Close()
    0 // return an integer exit code
0