結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,332 KB
testcase_01 AC 32 ms
53,328 KB
testcase_02 AC 32 ms
53,332 KB
testcase_03 AC 52 ms
65,852 KB
testcase_04 AC 54 ms
65,844 KB
testcase_05 AC 59 ms
68,700 KB
testcase_06 AC 70 ms
72,868 KB
testcase_07 AC 64 ms
70,792 KB
testcase_08 AC 60 ms
68,720 KB
testcase_09 AC 66 ms
68,700 KB
testcase_10 AC 56 ms
68,712 KB
testcase_11 AC 39 ms
59,472 KB
testcase_12 AC 46 ms
63,648 KB
testcase_13 AC 72 ms
72,864 KB
testcase_14 AC 66 ms
70,792 KB
testcase_15 AC 67 ms
70,792 KB
testcase_16 AC 51 ms
66,116 KB
testcase_17 AC 62 ms
68,704 KB
testcase_18 AC 56 ms
66,116 KB
testcase_19 AC 64 ms
70,792 KB
testcase_20 AC 59 ms
68,720 KB
testcase_21 AC 53 ms
66,124 KB
testcase_22 AC 66 ms
70,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,x = map(int,input().split())
z = [0]*x
for _ in range(n):
    a,b = map(int,input().split())
    now = a-1
    for i in range(b):
        sei_zahyo = now + i
        hu_zahyo = now - i
        if 0 <= sei_zahyo < x:
            z[sei_zahyo] = max(z[sei_zahyo],b-i)
        if 0 <= hu_zahyo < x:
            z[hu_zahyo] = max(z[hu_zahyo],b-i)
print(*z)
0