結果
問題 | No.678 2Dシューティングゲームの必殺ビーム |
ユーザー |
|
提出日時 | 2018-04-27 23:21:55 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 859 bytes |
コンパイル時間 | 91 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-27 22:18:06 |
合計ジャッジ時間 | 1,319 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 |
ソースコード
def debug(res_beam):for i, j in enumerate(res_beam):if not j :print(i,end=",")print()WIDTH = 1280HEIGHT = 1680N, 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 0right = d[2] if d[2] <= WIDTH else WIDTHif any(res_beam[left:right+1]):attacked[d[4]] = 1res_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)