結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー taktak
提出日時 2018-05-01 06:51:25
言語 F#
(F# 4.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 714 bytes
コンパイル時間 5,077 ms
コンパイル使用メモリ 157,968 KB
実行使用メモリ 24,948 KB
最終ジャッジ日時 2023-09-10 08:36:03
合計ジャッジ時間 6,798 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
20,828 KB
testcase_01 AC 83 ms
22,936 KB
testcase_02 AC 82 ms
22,832 KB
testcase_03 AC 84 ms
22,888 KB
testcase_04 AC 86 ms
24,924 KB
testcase_05 AC 85 ms
22,876 KB
testcase_06 AC 85 ms
24,872 KB
testcase_07 AC 84 ms
22,836 KB
testcase_08 AC 83 ms
22,920 KB
testcase_09 AC 85 ms
22,884 KB
testcase_10 AC 84 ms
22,956 KB
testcase_11 AC 83 ms
22,888 KB
testcase_12 AC 81 ms
20,736 KB
testcase_13 AC 85 ms
22,956 KB
testcase_14 AC 88 ms
22,828 KB
testcase_15 AC 86 ms
24,948 KB
testcase_16 AC 84 ms
22,812 KB
testcase_17 AC 85 ms
22,880 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

module Program

let read() = stdin.ReadLine().Split() |> Array.map int
let XL(x, _, _, _) = x
let YU(_, x, _, _) = x
let XR(_, _, x, _) = x
let YD(_, _, _, x) = x
let width, height = 2500, 2500

let N, xLB, xRB = 
    let t = read()
    t.[0], t.[1] + 500, t.[2] + 500

let info = 
    Array.init N (fun _ -> 
        let t = read() |> Array.map ((+) 500)
        (t.[0], t.[1], t.[2], t.[3]))

let front = Array.zeroCreate (width + 5)

for t in info do
    let YD = YD t
    for idx in (XL t)..(XR t) do
        front.[idx] <- max front.[idx] YD
for t in info do
    let YD = YD t
    front.[(max xLB (XL t))..(min xRB (XR t))]
    |> Array.exists ((=) YD)
    |> function | true -> 1 | _ -> 0
    |> printfn "%i"
0