結果

問題 No.2315 Flying Camera
ユーザー n_nan_na
提出日時 2023-05-27 17:05:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 369 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 76,756 KB
最終ジャッジ日時 2023-08-26 22:23:00
合計ジャッジ時間 7,445 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
76,384 KB
testcase_01 AC 83 ms
76,436 KB
testcase_02 AC 90 ms
76,496 KB
testcase_03 AC 247 ms
76,684 KB
testcase_04 AC 318 ms
76,476 KB
testcase_05 AC 290 ms
76,620 KB
testcase_06 AC 194 ms
76,396 KB
testcase_07 AC 330 ms
76,644 KB
testcase_08 AC 182 ms
76,532 KB
testcase_09 AC 105 ms
76,532 KB
testcase_10 AC 174 ms
76,628 KB
testcase_11 AC 342 ms
76,708 KB
testcase_12 AC 129 ms
76,580 KB
testcase_13 AC 106 ms
76,608 KB
testcase_14 AC 345 ms
76,576 KB
testcase_15 AC 252 ms
76,528 KB
testcase_16 AC 218 ms
76,644 KB
testcase_17 AC 165 ms
76,560 KB
testcase_18 AC 338 ms
76,648 KB
testcase_19 AC 258 ms
76,556 KB
testcase_20 AC 146 ms
76,560 KB
testcase_21 AC 203 ms
76,712 KB
testcase_22 AC 135 ms
76,504 KB
testcase_23 AC 80 ms
76,528 KB
testcase_24 AC 369 ms
76,580 KB
testcase_25 AC 84 ms
76,600 KB
testcase_26 AC 325 ms
76,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

INF = float("inf")

N = int(input())

A = []
for _ in range(N):
    x,y = map(int,input().split())
    A.append((x,y))
    
ans = INF
for cx in range(1,301):
    for cy in range(1,301):
        tmp = 0
        for nx,ny in A:
            tmp += abs(nx-cx) + abs(ny-cy)
        ans = min(ans, tmp)
        
print(ans)
0