結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー htkbhtkb
提出日時 2018-05-19 12:08:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 232 ms
コンパイル使用メモリ 10,988 KB
実行使用メモリ 8,304 KB
最終ジャッジ日時 2023-09-10 23:40:45
合計ジャッジ時間 1,346 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,844 KB
testcase_01 AC 16 ms
7,844 KB
testcase_02 AC 18 ms
7,788 KB
testcase_03 AC 18 ms
7,848 KB
testcase_04 AC 17 ms
7,752 KB
testcase_05 AC 18 ms
7,872 KB
testcase_06 AC 17 ms
7,788 KB
testcase_07 AC 17 ms
7,816 KB
testcase_08 AC 17 ms
7,752 KB
testcase_09 AC 17 ms
7,784 KB
testcase_10 AC 17 ms
7,800 KB
testcase_11 AC 17 ms
7,824 KB
testcase_12 AC 17 ms
7,800 KB
testcase_13 AC 17 ms
7,788 KB
testcase_14 AC 17 ms
8,288 KB
testcase_15 AC 19 ms
8,240 KB
testcase_16 AC 17 ms
7,800 KB
testcase_17 AC 17 ms
8,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
N, xLB, xRB = map(int, input().split())
enemies = [(i, *map(int, l.split())) for i, l in enumerate(sys.stdin.readlines(), start=1)]
enemies.sort(key=itemgetter(4), reverse=True)
result = [0]*(N+1)
beams = [1 if xLB <= x <= xRB else 0 for x in range(1281)]

for i, xl, yu, xr, yd in enemies:
    for x in range(max(0, xl), min(xr, 1280)+1):
        if beams[x]:
            result[i] = 1
            beams[x] = 0

print("\n".join(map(str, result[1:])))
0