結果

問題 No.2559 眩しい数直線
ユーザー KeeKee
提出日時 2024-03-30 18:10:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 1,213 bytes
コンパイル時間 374 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 68,460 KB
最終ジャッジ日時 2024-03-30 18:11:01
合計ジャッジ時間 2,743 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
55,608 KB
testcase_01 AC 41 ms
55,608 KB
testcase_02 AC 42 ms
55,608 KB
testcase_03 AC 55 ms
66,140 KB
testcase_04 AC 56 ms
66,140 KB
testcase_05 AC 60 ms
66,136 KB
testcase_06 AC 68 ms
68,460 KB
testcase_07 AC 65 ms
68,332 KB
testcase_08 AC 74 ms
68,316 KB
testcase_09 AC 61 ms
66,132 KB
testcase_10 AC 56 ms
66,136 KB
testcase_11 AC 50 ms
63,952 KB
testcase_12 AC 54 ms
63,924 KB
testcase_13 AC 65 ms
68,324 KB
testcase_14 AC 66 ms
68,336 KB
testcase_15 AC 66 ms
68,332 KB
testcase_16 AC 56 ms
66,268 KB
testcase_17 AC 62 ms
68,336 KB
testcase_18 AC 56 ms
66,140 KB
testcase_19 AC 66 ms
68,324 KB
testcase_20 AC 59 ms
66,128 KB
testcase_21 AC 55 ms
66,140 KB
testcase_22 AC 64 ms
68,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python3

import bisect
import collections
import heapq
import itertools
import math
import os
import sys


def main():
    n, x = read_ints()
    A = [None] * n
    B = [None] * n
    for i in range(n):
        A[i], B[i] = read_ints()

    ans = [0] * x
    for j in range(1, x + 1):
        t = 0
        for i in range(n):
            t = max(t, B[i] - abs(j - A[i]))
        ans[j - 1] = t

    print(*ans)


###############################################################################

DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def list2d(d1, d2, init=None):
    return [[init] * d2 for _ in range(d1)]


def list3d(d1, d2, d3, init=None):
    return [[[init] * d3 for _ in range(d2)] for _ in range(d1)]


def list4d(d1, d2, d3, d4, init=None):
    return [[[[init] * d4 for _ in range(d3)] for _ in range(d2)]
            for _ in range(d1)]


def debug(fmt, *args):
    if DEBUG:
        if args:
            print(fmt.format(*args), file=sys.stderr)
        else:
            print(fmt, file=sys.stderr)


if __name__ == '__main__':
    main()
0