結果

問題 No.2315 Flying Camera
ユーザー GrayCoderGrayCoder
提出日時 2023-05-26 21:57:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 493 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 12,676 KB
最終ジャッジ日時 2023-08-26 11:27:39
合計ジャッジ時間 7,120 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
8,224 KB
testcase_01 AC 67 ms
8,220 KB
testcase_02 AC 135 ms
8,160 KB
testcase_03 AC 1,881 ms
8,308 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 AC 1,345 ms
8,228 KB
testcase_07 TLE -
testcase_08 AC 1,090 ms
8,304 KB
testcase_09 AC 315 ms
8,296 KB
testcase_10 AC 1,134 ms
8,264 KB
testcase_11 TLE -
testcase_12 AC 557 ms
8,264 KB
testcase_13 AC 277 ms
8,168 KB
testcase_14 TLE -
testcase_15 TLE -
testcase_16 AC 1,670 ms
8,276 KB
testcase_17 AC 978 ms
8,260 KB
testcase_18 TLE -
testcase_19 TLE -
testcase_20 AC 811 ms
8,232 KB
testcase_21 AC 1,469 ms
8,112 KB
testcase_22 AC 702 ms
8,236 KB
testcase_23 AC 42 ms
8,224 KB
testcase_24 TLE -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
import sys


def main():
    sys.setrecursionlimit(1000000)
    input = lambda: sys.stdin.readline()[:-1]
    N = int(input())
    XY = [tuple(map(int, input().split())) for _ in [0] * N]

    ans = float("inf")
    for x, y in product(range(1, 301), repeat=2):
        d = 0
        for xi, yi in XY:
            d += abs(xi - x) + abs(yi - y)
        ans = min(ans, d)
    print(ans)


if not __debug__:
    f = open(sys.argv[1], "r")
    sys.stdin = f

main()
0