結果

問題 No.2559 眩しい数直線
ユーザー e60e256e60e256
提出日時 2023-12-02 14:45:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 582 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 68,412 KB
最終ジャッジ日時 2023-12-02 14:45:29
合計ジャッジ時間 2,153 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,460 KB
testcase_01 AC 31 ms
53,460 KB
testcase_02 AC 33 ms
53,460 KB
testcase_03 AC 42 ms
61,704 KB
testcase_04 AC 44 ms
63,896 KB
testcase_05 AC 47 ms
66,364 KB
testcase_06 AC 58 ms
68,404 KB
testcase_07 AC 55 ms
68,412 KB
testcase_08 AC 57 ms
68,404 KB
testcase_09 AC 51 ms
66,352 KB
testcase_10 AC 50 ms
64,144 KB
testcase_11 AC 37 ms
59,592 KB
testcase_12 AC 41 ms
61,704 KB
testcase_13 AC 57 ms
68,412 KB
testcase_14 AC 57 ms
68,412 KB
testcase_15 AC 58 ms
68,400 KB
testcase_16 AC 42 ms
61,972 KB
testcase_17 AC 57 ms
68,412 KB
testcase_18 AC 48 ms
63,896 KB
testcase_19 AC 63 ms
68,412 KB
testcase_20 AC 51 ms
66,352 KB
testcase_21 AC 44 ms
61,968 KB
testcase_22 AC 54 ms
68,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X = map(int,input().split())
A = []
B = []

for i in range(N):
    a, b = map(int, input().split())
    A.append(a-1)
    B.append(b)

lightmax = [0 for _ in range(X)]

for i in range(N):
    pos = A[i]
    intensity = B[i]
    lightmax[pos] = max(lightmax[pos], intensity, 0)
    # 前
    for j in range(A[i]-1, -1, -1):
        intensity -= 1
        #print(j, A[i])
        lightmax[j] = max(lightmax[j], intensity, 0)
    intensity = B[i]
    for j in range(A[i]+1, X, 1):
        intensity -= 1
        lightmax[j] = max(lightmax[j], intensity, 0)
        
print(*lightmax)
0