結果

問題 No.2559 眩しい数直線
ユーザー bluebery1001bluebery1001
提出日時 2023-11-02 19:37:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 280 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 11,832 KB
実行使用メモリ 10,280 KB
最終ジャッジ日時 2023-11-05 11:20:10
合計ジャッジ時間 4,630 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,104 KB
testcase_01 AC 28 ms
10,104 KB
testcase_02 AC 28 ms
10,104 KB
testcase_03 AC 73 ms
10,156 KB
testcase_04 AC 75 ms
10,176 KB
testcase_05 AC 108 ms
10,168 KB
testcase_06 AC 268 ms
10,276 KB
testcase_07 AC 231 ms
10,224 KB
testcase_08 AC 246 ms
10,200 KB
testcase_09 AC 160 ms
10,224 KB
testcase_10 AC 108 ms
10,136 KB
testcase_11 AC 29 ms
10,148 KB
testcase_12 AC 54 ms
10,120 KB
testcase_13 AC 217 ms
10,280 KB
testcase_14 AC 239 ms
10,232 KB
testcase_15 AC 280 ms
10,260 KB
testcase_16 AC 34 ms
10,220 KB
testcase_17 AC 226 ms
10,204 KB
testcase_18 AC 72 ms
10,180 KB
testcase_19 AC 232 ms
10,276 KB
testcase_20 AC 141 ms
10,172 KB
testcase_21 AC 42 ms
10,200 KB
testcase_22 AC 203 ms
10,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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