結果

問題 No.2315 Flying Camera
ユーザー とろちゃとろちゃ
提出日時 2023-05-26 21:27:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 529 ms / 2,000 ms
コード長 932 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 76,624 KB
最終ジャッジ日時 2023-08-26 10:11:00
合計ジャッジ時間 9,604 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
76,120 KB
testcase_01 AC 93 ms
76,440 KB
testcase_02 AC 103 ms
76,440 KB
testcase_03 AC 351 ms
76,264 KB
testcase_04 AC 485 ms
76,268 KB
testcase_05 AC 404 ms
76,348 KB
testcase_06 AC 265 ms
76,540 KB
testcase_07 AC 472 ms
76,488 KB
testcase_08 AC 223 ms
76,360 KB
testcase_09 AC 124 ms
76,268 KB
testcase_10 AC 231 ms
76,448 KB
testcase_11 AC 474 ms
76,524 KB
testcase_12 AC 157 ms
76,280 KB
testcase_13 AC 123 ms
76,272 KB
testcase_14 AC 491 ms
76,368 KB
testcase_15 AC 361 ms
76,472 KB
testcase_16 AC 305 ms
76,372 KB
testcase_17 AC 211 ms
76,260 KB
testcase_18 AC 487 ms
76,380 KB
testcase_19 AC 376 ms
76,448 KB
testcase_20 AC 190 ms
76,380 KB
testcase_21 AC 271 ms
76,440 KB
testcase_22 AC 174 ms
76,624 KB
testcase_23 AC 85 ms
76,408 KB
testcase_24 AC 529 ms
76,080 KB
testcase_25 AC 93 ms
76,176 KB
testcase_26 AC 497 ms
75,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1")
# from bisect import *
# from collections import *
# from heapq import *
# from itertools import *
# from math import *
# from datetime import *
# from decimal import*
# from string import ascii_lowercase,ascii_uppercase
# import numpy as np
import sys
import os

# sys.setrecursionlimit(10**6)
INF = 10**18
MOD = 998244353
# MOD = 10**9 + 7
File = open("input.txt", "r") if os.path.exists("input.txt") else sys.stdin


def input():
    return File.readline()[:-1]


# ///////////////////////////////////////////////////////////////////////////


N = int(input())
wani = [list(map(int, input().split())) for _ in range(N)]
ans = INF
for i in range(301):
    for j in range(301):
        total = 0
        for k in range(N):
            dist = abs(wani[k][0] - i) + abs(wani[k][1] - j)
            total += dist
        if total < ans:
            ans = total
print(ans)
0