結果

問題 No.2559 眩しい数直線
ユーザー anonymouslyanonymously
提出日時 2023-12-02 15:43:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 305 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2023-12-02 15:43:50
合計ジャッジ時間 4,621 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
9,984 KB
testcase_01 AC 26 ms
9,984 KB
testcase_02 AC 26 ms
9,984 KB
testcase_03 AC 69 ms
10,112 KB
testcase_04 AC 74 ms
10,112 KB
testcase_05 AC 102 ms
10,112 KB
testcase_06 AC 305 ms
10,112 KB
testcase_07 AC 212 ms
10,112 KB
testcase_08 AC 192 ms
10,112 KB
testcase_09 AC 170 ms
10,112 KB
testcase_10 AC 76 ms
10,112 KB
testcase_11 AC 27 ms
10,112 KB
testcase_12 AC 40 ms
9,984 KB
testcase_13 AC 230 ms
10,112 KB
testcase_14 AC 231 ms
10,112 KB
testcase_15 AC 276 ms
10,112 KB
testcase_16 AC 30 ms
10,112 KB
testcase_17 AC 175 ms
10,112 KB
testcase_18 AC 69 ms
10,112 KB
testcase_19 AC 244 ms
10,112 KB
testcase_20 AC 118 ms
10,112 KB
testcase_21 AC 41 ms
10,112 KB
testcase_22 AC 205 ms
10,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,x=map(int,input().split())
L=[0]*(x+1)
for i in range(n):
	a,b=map(int,input().split())
	for j in range(max(a-b+1,0),min(a+b,x+1)):
		if j<a:
			L[j]=max(L[j],b-a+j)
		else:
			L[j]=max(L[j],b+a-j)
print(*L[1:])
0