結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,460 KB
testcase_01 AC 33 ms
53,460 KB
testcase_02 AC 33 ms
53,460 KB
testcase_03 AC 52 ms
65,980 KB
testcase_04 AC 55 ms
65,980 KB
testcase_05 AC 62 ms
70,920 KB
testcase_06 AC 73 ms
73,004 KB
testcase_07 AC 67 ms
70,912 KB
testcase_08 AC 63 ms
70,916 KB
testcase_09 AC 68 ms
70,924 KB
testcase_10 AC 58 ms
68,824 KB
testcase_11 AC 41 ms
61,844 KB
testcase_12 AC 49 ms
66,792 KB
testcase_13 AC 74 ms
73,008 KB
testcase_14 AC 68 ms
70,924 KB
testcase_15 AC 68 ms
70,924 KB
testcase_16 AC 53 ms
66,124 KB
testcase_17 AC 65 ms
70,928 KB
testcase_18 AC 58 ms
68,180 KB
testcase_19 AC 71 ms
72,996 KB
testcase_20 AC 64 ms
70,924 KB
testcase_21 AC 54 ms
66,112 KB
testcase_22 AC 70 ms
72,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X = map(int,input().split())
mabu = [0]*X
for i in range(N):
    a, b = map(int,input().split())
    a -= 1
    mabu[a] = max(mabu[a], b)
    for j in range(X):
        if a+j+1 <= X-1:
            mabu[a+j+1] = max(mabu[a+j+1], b-j-1)
        if a-j-1 >= 0:
            mabu[a-j-1] = max(mabu[a-j-1], b-j-1)
print(*mabu)

0