結果

問題 No.2559 眩しい数直線
ユーザー superzugansuperzugan
提出日時 2024-01-14 03:29:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,183 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 1,496 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2024-01-14 03:29:33
合計ジャッジ時間 11,734 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,984 KB
testcase_01 AC 29 ms
9,984 KB
testcase_02 AC 28 ms
9,984 KB
testcase_03 AC 172 ms
9,984 KB
testcase_04 AC 196 ms
9,984 KB
testcase_05 AC 281 ms
9,984 KB
testcase_06 AC 1,183 ms
9,984 KB
testcase_07 AC 718 ms
9,984 KB
testcase_08 AC 599 ms
9,984 KB
testcase_09 AC 614 ms
9,984 KB
testcase_10 AC 194 ms
9,984 KB
testcase_11 AC 31 ms
9,984 KB
testcase_12 AC 72 ms
9,984 KB
testcase_13 AC 1,018 ms
10,112 KB
testcase_14 AC 833 ms
9,984 KB
testcase_15 AC 1,126 ms
9,984 KB
testcase_16 AC 52 ms
9,984 KB
testcase_17 AC 575 ms
9,984 KB
testcase_18 AC 197 ms
9,984 KB
testcase_19 AC 1,026 ms
9,984 KB
testcase_20 AC 360 ms
9,984 KB
testcase_21 AC 82 ms
9,984 KB
testcase_22 AC 782 ms
9,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,x=map(int,input().split())
lst=[0]*x
for _ in range(n):
	a,b=map(int,input().split())
	a-=1
	i=0
	while(a+i<x or a-i>=0):
		if 0<=a+i<x:
			t=max(lst[a+i],max(b-(1*i),0))
			lst[a+i]=max(t,lst[a+i])
		if 0<=a-i<x:
			u=max(lst[a-i],max(b-(1*i),0))
			lst[a-i]=max(u,lst[a-i])
		# print("A:",lst)
		i+=1
print(*lst)
0