結果

問題 No.2315 Flying Camera
ユーザー lloyzlloyz
提出日時 2023-05-26 21:23:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 490 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 1,022 ms
コンパイル使用メモリ 86,560 KB
実行使用メモリ 76,752 KB
最終ジャッジ日時 2023-08-26 09:55:04
合計ジャッジ時間 8,736 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
75,808 KB
testcase_01 AC 91 ms
75,872 KB
testcase_02 AC 96 ms
76,152 KB
testcase_03 AC 325 ms
76,256 KB
testcase_04 AC 430 ms
76,676 KB
testcase_05 AC 374 ms
76,120 KB
testcase_06 AC 230 ms
76,100 KB
testcase_07 AC 434 ms
76,256 KB
testcase_08 AC 203 ms
76,752 KB
testcase_09 AC 117 ms
75,884 KB
testcase_10 AC 210 ms
75,888 KB
testcase_11 AC 437 ms
76,116 KB
testcase_12 AC 145 ms
75,884 KB
testcase_13 AC 112 ms
76,336 KB
testcase_14 AC 452 ms
76,228 KB
testcase_15 AC 336 ms
76,120 KB
testcase_16 AC 277 ms
76,000 KB
testcase_17 AC 192 ms
76,572 KB
testcase_18 AC 448 ms
75,856 KB
testcase_19 AC 347 ms
76,000 KB
testcase_20 AC 168 ms
76,092 KB
testcase_21 AC 245 ms
76,252 KB
testcase_22 AC 158 ms
75,888 KB
testcase_23 AC 89 ms
76,232 KB
testcase_24 AC 490 ms
76,484 KB
testcase_25 AC 89 ms
76,140 KB
testcase_26 AC 460 ms
76,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
P = [list(map(int, input().split())) for _ in range(n)]
ans = 10**18
for x in range(1, 301):
    for y in range(1, 301):
        res = 0
        for i in range(n):
            cx, cy = P[i]
            res += abs(x - cx) + abs(y - cy)
        ans = min(ans, res)
print(ans)
0