結果

問題 No.2559 眩しい数直線
ユーザー Tatsuo MatsuuraTatsuo Matsuura
提出日時 2023-12-02 15:10:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 68,416 KB
最終ジャッジ日時 2023-12-02 15:10:44
合計ジャッジ時間 2,292 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,332 KB
testcase_01 AC 36 ms
53,332 KB
testcase_02 AC 36 ms
53,332 KB
testcase_03 AC 51 ms
64,176 KB
testcase_04 AC 51 ms
64,172 KB
testcase_05 AC 53 ms
64,168 KB
testcase_06 AC 70 ms
68,416 KB
testcase_07 AC 68 ms
66,348 KB
testcase_08 AC 65 ms
66,332 KB
testcase_09 AC 58 ms
66,224 KB
testcase_10 AC 53 ms
64,168 KB
testcase_11 AC 42 ms
61,980 KB
testcase_12 AC 44 ms
62,088 KB
testcase_13 AC 62 ms
66,220 KB
testcase_14 AC 66 ms
68,416 KB
testcase_15 AC 70 ms
68,408 KB
testcase_16 AC 49 ms
64,172 KB
testcase_17 AC 63 ms
66,348 KB
testcase_18 AC 48 ms
64,172 KB
testcase_19 AC 68 ms
66,220 KB
testcase_20 AC 56 ms
64,152 KB
testcase_21 AC 45 ms
64,176 KB
testcase_22 AC 60 ms
66,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

inputs = input()
inputs_arr = inputs.split(" ")

N = int(inputs_arr[0])
X = int(inputs_arr[1])
datas = []

for i in range(N):
	inputs = input()
	inputs_arr = inputs.split(" ")
	datas.append([int(inputs_arr[0]), int(inputs_arr[1])])

display_power = ""

for i in range(X):
	max_power = 0

	for j in range(N):
		position = datas[j][0]
		power = datas[j][1]
		position_len = abs((i + 1) - position)
		tmp_power = power - position_len

		if tmp_power > max_power:
			max_power = tmp_power

	display_power = display_power + str(max_power) + " "

print(display_power[:-1])
0