結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー konabekonabe
提出日時 2018-04-27 23:13:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 851 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-27 22:13:55
合計ジャッジ時間 1,371 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,880 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 WA -
testcase_05 AC 30 ms
10,624 KB
testcase_06 AC 30 ms
10,624 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 30 ms
10,752 KB
testcase_15 WA -
testcase_16 AC 30 ms
10,624 KB
testcase_17 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def debug(res_beam):
   for i, j in enumerate(res_beam):
    if j :
        print("@",end="")
    else:
        print("_",end="")
    if i % 50 == 49:
        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 = [True for i in range(WIDTH+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]):
       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