結果

問題 No.2559 眩しい数直線
ユーザー kamath0165kamath0165
提出日時 2023-12-02 15:11:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 463 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 72,752 KB
最終ジャッジ日時 2023-12-02 15:11:19
合計ジャッジ時間 2,337 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 34 ms
53,460 KB
testcase_03 AC 53 ms
63,916 KB
testcase_04 AC 52 ms
66,008 KB
testcase_05 AC 58 ms
68,468 KB
testcase_06 AC 77 ms
72,752 KB
testcase_07 AC 70 ms
72,748 KB
testcase_08 AC 70 ms
72,732 KB
testcase_09 AC 63 ms
68,464 KB
testcase_10 AC 55 ms
66,260 KB
testcase_11 AC 39 ms
59,572 KB
testcase_12 AC 47 ms
63,944 KB
testcase_13 AC 70 ms
72,748 KB
testcase_14 AC 74 ms
72,748 KB
testcase_15 AC 73 ms
72,748 KB
testcase_16 AC 51 ms
66,164 KB
testcase_17 AC 70 ms
70,652 KB
testcase_18 AC 53 ms
66,008 KB
testcase_19 AC 70 ms
72,752 KB
testcase_20 AC 59 ms
68,468 KB
testcase_21 AC 51 ms
64,084 KB
testcase_22 AC 64 ms
70,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,x= map(int,input().split())
light= [list(map(int,input().split())) for i in range(n)]
ans= [0 for i in range(x)]
for i in range(n):
  for ipp in range(light[i][1]):
    if light[i][0]-1+ipp >= x:
      break
    ans[light[i][0]-1+ipp]= max(light[i][1]-ipp,ans[light[i][0]-1+ipp])
for i in range(n):
  for ipp in range(light[i][1]-1):
    if light[i][0]-ipp-2 < 0:
      break
    ans[light[i][0]-ipp-2]= max(light[i][1]-ipp-1,ans[light[i][0]-ipp-2])
print(*ans)
0