結果

問題 No.2315 Flying Camera
ユーザー flygonflygon
提出日時 2023-05-26 21:23:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 574 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 617 ms
コンパイル使用メモリ 86,784 KB
実行使用メモリ 76,812 KB
最終ジャッジ日時 2023-08-26 09:53:24
合計ジャッジ時間 9,638 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
76,268 KB
testcase_01 AC 86 ms
76,196 KB
testcase_02 AC 91 ms
76,232 KB
testcase_03 AC 371 ms
76,372 KB
testcase_04 AC 503 ms
76,768 KB
testcase_05 AC 429 ms
76,300 KB
testcase_06 AC 260 ms
76,488 KB
testcase_07 AC 503 ms
76,800 KB
testcase_08 AC 222 ms
76,348 KB
testcase_09 AC 114 ms
76,280 KB
testcase_10 AC 227 ms
76,280 KB
testcase_11 AC 511 ms
76,432 KB
testcase_12 AC 151 ms
76,372 KB
testcase_13 AC 116 ms
76,300 KB
testcase_14 AC 513 ms
76,540 KB
testcase_15 AC 374 ms
76,444 KB
testcase_16 AC 306 ms
76,232 KB
testcase_17 AC 203 ms
76,640 KB
testcase_18 AC 507 ms
76,680 KB
testcase_19 AC 401 ms
76,176 KB
testcase_20 AC 182 ms
76,068 KB
testcase_21 AC 274 ms
76,204 KB
testcase_22 AC 165 ms
76,180 KB
testcase_23 AC 76 ms
76,212 KB
testcase_24 AC 574 ms
76,812 KB
testcase_25 AC 83 ms
76,372 KB
testcase_26 AC 523 ms
76,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]

ans = float("inf")

for x in range(310):
    for y in range(310):
        tmp = 0
        for i in range(n):
            tmp += abs(x-xy[i][0]) + abs(y-xy[i][1])
        ans = min(ans, tmp)

print(ans)
0