結果

問題 No.2559 眩しい数直線
ユーザー ch1channnch1channn
提出日時 2023-12-02 14:57:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 805 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 68,428 KB
最終ジャッジ日時 2023-12-02 14:57:55
合計ジャッジ時間 2,301 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,460 KB
testcase_01 AC 32 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 52 ms
64,024 KB
testcase_04 AC 54 ms
64,028 KB
testcase_05 AC 54 ms
64,028 KB
testcase_06 AC 74 ms
68,420 KB
testcase_07 AC 58 ms
66,364 KB
testcase_08 AC 56 ms
66,348 KB
testcase_09 AC 60 ms
66,100 KB
testcase_10 AC 49 ms
64,028 KB
testcase_11 AC 41 ms
61,980 KB
testcase_12 AC 44 ms
64,028 KB
testcase_13 AC 60 ms
66,368 KB
testcase_14 AC 61 ms
68,428 KB
testcase_15 AC 67 ms
66,360 KB
testcase_16 AC 54 ms
64,032 KB
testcase_17 AC 57 ms
66,364 KB
testcase_18 AC 50 ms
64,028 KB
testcase_19 AC 60 ms
66,364 KB
testcase_20 AC 51 ms
64,152 KB
testcase_21 AC 48 ms
64,032 KB
testcase_22 AC 59 ms
66,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
if sys.platform =='ios':
	import clipboard
	a=clipboard.get()
	a = a.split('\n')
	text = '\n'.join(a)
	with open('input_file.txt','w') as f:
		f.write(text)
	sys.stdin = open('input_file.txt')
sys.setrecursionlimit(410000000)
stdin = sys.stdin 
def ni():return int(ns())
def na():return list(map(int, stdin.readline().split()))
def ns():return stdin.readline().strip()
def nm():return map(int,input().split())
def na_1():return list(map(lambda x:int(x)*(-1), stdin.readline().split()))
def na_2():return list(map(lambda x:int(x)-1, stdin.readline().split()))
rnage=range
rnge=range
rage = range


N,X = nm()

AB = [na()for i in range(N)]

ans = []
for x in range(1,X+1):
	mx = 0
	for a,b in AB:
		dist = abs(x-a)
		akarusa = max(b-dist,0)
		mx = max(mx,akarusa)
		
	ans.append(mx)
	
print(*ans)
0