結果

問題 No.2559 眩しい数直線
ユーザー detteiuudetteiuu
提出日時 2024-11-28 22:42:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 391 bytes
コンパイル時間 422 ms
コンパイル使用メモリ 82,792 KB
実行使用メモリ 69,120 KB
最終ジャッジ日時 2024-11-28 22:42:41
合計ジャッジ時間 2,432 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,096 KB
testcase_01 AC 32 ms
51,968 KB
testcase_02 AC 32 ms
51,968 KB
testcase_03 AC 45 ms
61,696 KB
testcase_04 AC 47 ms
62,336 KB
testcase_05 AC 51 ms
64,128 KB
testcase_06 AC 65 ms
68,480 KB
testcase_07 AC 60 ms
67,712 KB
testcase_08 AC 59 ms
68,352 KB
testcase_09 AC 51 ms
65,280 KB
testcase_10 AC 49 ms
63,360 KB
testcase_11 AC 50 ms
59,008 KB
testcase_12 AC 41 ms
60,288 KB
testcase_13 AC 56 ms
67,584 KB
testcase_14 AC 58 ms
67,968 KB
testcase_15 AC 59 ms
69,120 KB
testcase_16 AC 43 ms
62,080 KB
testcase_17 AC 56 ms
67,840 KB
testcase_18 AC 45 ms
62,720 KB
testcase_19 AC 58 ms
67,200 KB
testcase_20 AC 52 ms
65,664 KB
testcase_21 AC 43 ms
61,824 KB
testcase_22 AC 56 ms
67,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

C = [0]*X
for A, B in AB:
    A -= 1
    now = A
    strength = B
    while 0 <= now:
        C[now] = max(C[now], strength)
        now -= 1
        strength -= 1
    now = A
    strength = B
    while now < X:
        C[now] = max(C[now], strength)
        now += 1
        strength -= 1

print(*C)
0