結果

問題 No.2315 Flying Camera
ユーザー miya145592miya145592
提出日時 2023-05-26 21:43:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 388 bytes
コンパイル時間 710 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 75,848 KB
最終ジャッジ日時 2023-08-26 10:58:57
合計ジャッジ時間 4,065 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,244 KB
testcase_01 AC 66 ms
71,580 KB
testcase_02 AC 63 ms
71,392 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 66 ms
71,392 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 70 ms
75,744 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 65 ms
71,392 KB
testcase_24 AC 69 ms
71,540 KB
testcase_25 AC 65 ms
71,308 KB
testcase_26 AC 72 ms
75,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]
SX, SY = 0, 0
for x, y in XY:
    SX+=x
    SY+=y
x = x2 = SX//N
y = y2 = SY//N
if SX%N!=0:
    x2+=1
if SY%N!=0:
    y2+=1
INF = 10**9
ans = INF
for i in range(x, x2+1):
    for j in range(y, y2+1):
        S = 0
        for sx, sy in XY:
            S += abs(i-sx) +abs(j-sy)
        ans = min(ans, S)
print(ans)
0