結果

問題 No.2559 眩しい数直線
ユーザー PreginaPregina
提出日時 2023-12-02 20:44:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 72,864 KB
最終ジャッジ日時 2023-12-02 20:44:07
合計ジャッジ時間 2,835 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,332 KB
testcase_01 AC 37 ms
53,332 KB
testcase_02 AC 38 ms
53,332 KB
testcase_03 AC 57 ms
63,788 KB
testcase_04 AC 61 ms
65,856 KB
testcase_05 AC 67 ms
68,684 KB
testcase_06 AC 75 ms
72,864 KB
testcase_07 AC 72 ms
70,796 KB
testcase_08 AC 69 ms
70,776 KB
testcase_09 AC 70 ms
70,796 KB
testcase_10 AC 67 ms
68,720 KB
testcase_11 AC 43 ms
59,464 KB
testcase_12 AC 54 ms
63,780 KB
testcase_13 AC 74 ms
72,864 KB
testcase_14 AC 72 ms
70,800 KB
testcase_15 AC 71 ms
70,792 KB
testcase_16 AC 56 ms
65,984 KB
testcase_17 AC 68 ms
68,716 KB
testcase_18 AC 60 ms
65,984 KB
testcase_19 AC 70 ms
70,792 KB
testcase_20 AC 69 ms
70,780 KB
testcase_21 AC 57 ms
65,984 KB
testcase_22 AC 73 ms
72,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X = map(int, input().split())
town = [0]*1001

for _ in range(N):
    A, B = map(int, input().split())
    town[A] = max(town[A], B)
    for i in range(1, B):
        if A+i <= 1000:
            town[A+i] = max(town[A+i], B-i)
        if A-i >= 0:
            town[A-i] = max(town[A-i], B-i)

print(*town[1:X+1])
0