結果

問題 No.2559 眩しい数直線
ユーザー tetztetz
提出日時 2023-12-02 14:57:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 73,460 KB
最終ジャッジ日時 2023-12-02 14:57:32
合計ジャッジ時間 2,410 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,460 KB
testcase_01 AC 31 ms
53,460 KB
testcase_02 AC 31 ms
53,460 KB
testcase_03 AC 49 ms
65,980 KB
testcase_04 AC 54 ms
65,976 KB
testcase_05 AC 54 ms
68,416 KB
testcase_06 AC 69 ms
73,460 KB
testcase_07 AC 65 ms
72,688 KB
testcase_08 AC 61 ms
70,604 KB
testcase_09 AC 56 ms
68,416 KB
testcase_10 AC 50 ms
66,212 KB
testcase_11 AC 40 ms
59,592 KB
testcase_12 AC 46 ms
63,896 KB
testcase_13 AC 66 ms
72,692 KB
testcase_14 AC 75 ms
72,688 KB
testcase_15 AC 66 ms
72,692 KB
testcase_16 AC 49 ms
66,112 KB
testcase_17 AC 63 ms
70,600 KB
testcase_18 AC 53 ms
68,036 KB
testcase_19 AC 63 ms
72,692 KB
testcase_20 AC 59 ms
68,412 KB
testcase_21 AC 51 ms
66,112 KB
testcase_22 AC 63 ms
70,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
l = [0] * X
for ai, bi in ab:
    ai -= 1
    for j in range(bi):
        if ai - j >= 0:
            l[ai - j] = max(l[ai - j], bi - j)
        if ai + j < X:
            l[ai + j] = max(l[ai + j], bi - j)
print(*l)
0