結果

問題 No.2315 Flying Camera
ユーザー minimumminimum
提出日時 2023-05-26 21:54:43
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 390 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 638 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 76,552 KB
最終ジャッジ日時 2023-08-26 11:21:48
合計ジャッジ時間 8,169 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
76,308 KB
testcase_01 AC 90 ms
76,384 KB
testcase_02 AC 98 ms
76,320 KB
testcase_03 AC 264 ms
76,180 KB
testcase_04 AC 348 ms
76,384 KB
testcase_05 AC 308 ms
76,300 KB
testcase_06 AC 210 ms
76,376 KB
testcase_07 AC 356 ms
76,300 KB
testcase_08 AC 182 ms
76,360 KB
testcase_09 AC 112 ms
76,212 KB
testcase_10 AC 189 ms
76,376 KB
testcase_11 AC 355 ms
76,388 KB
testcase_12 AC 134 ms
76,272 KB
testcase_13 AC 106 ms
76,388 KB
testcase_14 AC 364 ms
76,220 KB
testcase_15 AC 279 ms
76,328 KB
testcase_16 AC 235 ms
76,264 KB
testcase_17 AC 174 ms
76,552 KB
testcase_18 AC 362 ms
76,384 KB
testcase_19 AC 289 ms
76,308 KB
testcase_20 AC 156 ms
76,268 KB
testcase_21 AC 330 ms
76,488 KB
testcase_22 AC 145 ms
76,196 KB
testcase_23 AC 86 ms
76,384 KB
testcase_24 AC 390 ms
76,300 KB
testcase_25 AC 91 ms
76,396 KB
testcase_26 AC 371 ms
76,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
xs, ys = [], []
for i in range(N):
    x, y = map(int, input().split())
    xs.append(x)
    ys.append(y)

ans = 10 ** 18
for x in range(310):
    for y in range(310):
        s = 0
        for i in range(N):
            s += abs(xs[i] - x) + abs(ys[i] - y)
        ans = min(ans, s)
    
print(ans)
0