結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー Mr.FukuMr.Fuku
提出日時 2018-06-29 21:11:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 757 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 7,980 KB
最終ジャッジ日時 2023-09-13 15:17:44
合計ジャッジ時間 1,579 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,792 KB
testcase_01 AC 16 ms
7,856 KB
testcase_02 AC 16 ms
7,924 KB
testcase_03 AC 15 ms
7,968 KB
testcase_04 AC 16 ms
7,792 KB
testcase_05 AC 16 ms
7,768 KB
testcase_06 AC 17 ms
7,976 KB
testcase_07 AC 16 ms
7,852 KB
testcase_08 AC 16 ms
7,864 KB
testcase_09 AC 17 ms
7,880 KB
testcase_10 AC 17 ms
7,840 KB
testcase_11 AC 16 ms
7,980 KB
testcase_12 AC 17 ms
7,876 KB
testcase_13 AC 16 ms
7,792 KB
testcase_14 AC 17 ms
7,920 KB
testcase_15 AC 17 ms
7,880 KB
testcase_16 AC 17 ms
7,832 KB
testcase_17 AC 17 ms
7,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!

N,beamL,beamR = input().split()
N,beamL,beamR = int(N),int(beamL),int(beamR)

beam_lst = [1]*(beamR-beamL+1)
beam_in = [0]*(beamR-beamL+1)

for i in range(1,N+1):
    enemy = list(map(int,input().split()))
    if beamL>enemy[2] or beamR<enemy[0]:
        continue
    if enemy[0]<beamL:
        enemy[0]=beamL
    if enemy[2]>beamR:
        enemy[2]=beamR
    enemy_w = enemy[2] - enemy[0] + 1
    enemy_position = enemy[0] - beamL
    enemy_bottom = enemy[3]
    for j in range(enemy_position,enemy_w+enemy_position):
        if beam_lst[j]<enemy_bottom:
            beam_lst[j]=enemy_bottom
            beam_in[j] = i

enemy_lst = [0]*(N+1)
for i in set(beam_in):
    enemy_lst[i]=1

for i in enemy_lst[1:]:
    print(i)
0