結果

問題 No.2559 眩しい数直線
ユーザー KudeKude
提出日時 2023-12-12 22:31:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 65,812 KB
最終ジャッジ日時 2023-12-12 22:31:24
合計ジャッジ時間 2,637 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,332 KB
testcase_01 AC 34 ms
53,328 KB
testcase_02 AC 33 ms
53,332 KB
testcase_03 AC 38 ms
55,456 KB
testcase_04 AC 42 ms
59,452 KB
testcase_05 AC 44 ms
61,004 KB
testcase_06 AC 54 ms
65,812 KB
testcase_07 AC 52 ms
63,744 KB
testcase_08 AC 51 ms
63,064 KB
testcase_09 AC 48 ms
63,764 KB
testcase_10 AC 46 ms
55,456 KB
testcase_11 AC 37 ms
53,332 KB
testcase_12 AC 37 ms
53,332 KB
testcase_13 AC 50 ms
63,748 KB
testcase_14 AC 51 ms
63,712 KB
testcase_15 AC 54 ms
65,812 KB
testcase_16 AC 43 ms
61,704 KB
testcase_17 AC 50 ms
63,064 KB
testcase_18 AC 42 ms
59,452 KB
testcase_19 AC 52 ms
63,748 KB
testcase_20 AC 46 ms
60,988 KB
testcase_21 AC 44 ms
61,704 KB
testcase_22 AC 51 ms
63,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, x = map(int, input().split())
ans = [0] * x
d = [0] * x
for _ in range(n):
    a, b = map(int, input().split())
    a -= 1
    d[a] = max(d[a], b)
ans = [0] * x
for _ in range(2):
    now = 0
    for i in range(x):
        now = max(d[i], now)
        ans[i] = max(ans[i], now)
        now -= 1
    ans.reverse()
    d.reverse()
print(*ans)
0