結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー konabekonabe
提出日時 2018-04-27 23:21:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 859 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 11,016 KB
実行使用メモリ 8,404 KB
最終ジャッジ日時 2023-09-10 06:49:14
合計ジャッジ時間 1,323 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
7,848 KB
testcase_01 AC 18 ms
7,808 KB
testcase_02 AC 18 ms
7,892 KB
testcase_03 AC 18 ms
7,840 KB
testcase_04 AC 18 ms
8,276 KB
testcase_05 AC 17 ms
8,264 KB
testcase_06 AC 17 ms
8,232 KB
testcase_07 AC 17 ms
7,964 KB
testcase_08 AC 17 ms
7,852 KB
testcase_09 AC 17 ms
7,968 KB
testcase_10 AC 17 ms
7,876 KB
testcase_11 AC 16 ms
7,848 KB
testcase_12 AC 16 ms
7,972 KB
testcase_13 AC 17 ms
8,264 KB
testcase_14 AC 21 ms
8,252 KB
testcase_15 AC 17 ms
8,336 KB
testcase_16 AC 17 ms
7,848 KB
testcase_17 AC 17 ms
8,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def debug(res_beam):
    for i, j in enumerate(res_beam):
        if not j :
            print(i,end=",")
    print()
WIDTH = 1280
HEIGHT = 1680

N, xLB, xRB = list(map(int, input().split()))
data = [list(map(int, input().split())) for i in range(N)]
data = [data[i] + [i] for i in range(N)]

res_beam = [False for i in range(WIDTH+1)]
res_beam[xLB:xRB+1] = [True for i in range(xRB-xLB+1)]

attacked = [ 0 for i in range(N)]

data.sort(key=lambda x:x[3])

for d in data[::-1]:
    #print(d)
    left = d[0] if d[0] >= 0 else 0
    right = d[2] if d[2] <= WIDTH else WIDTH
    if any(res_beam[left:right+1]):
       attacked[d[4]] = 1
       res_beam[left:right+1] = [False for i in range(right-left+1)]
       #print([False for i in range(d[2]-d[1]+2)])
       #print(d[0], d[2], len(res_beam))
       #debug(res_beam)

for i in attacked:
    print(i)
    
0