結果

問題 No.2315 Flying Camera
ユーザー 倉
提出日時 2023-05-26 21:57:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 246 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 667 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 85,744 KB
最終ジャッジ日時 2023-08-26 11:25:45
合計ジャッジ時間 8,668 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 237 ms
85,572 KB
testcase_01 AC 236 ms
85,668 KB
testcase_02 AC 238 ms
85,728 KB
testcase_03 AC 245 ms
85,744 KB
testcase_04 AC 242 ms
85,432 KB
testcase_05 AC 241 ms
85,648 KB
testcase_06 AC 241 ms
85,668 KB
testcase_07 AC 243 ms
85,644 KB
testcase_08 AC 239 ms
85,432 KB
testcase_09 AC 240 ms
85,708 KB
testcase_10 AC 241 ms
85,560 KB
testcase_11 AC 242 ms
85,636 KB
testcase_12 AC 239 ms
85,672 KB
testcase_13 AC 240 ms
85,724 KB
testcase_14 AC 243 ms
85,644 KB
testcase_15 AC 240 ms
85,740 KB
testcase_16 AC 238 ms
85,692 KB
testcase_17 AC 242 ms
85,408 KB
testcase_18 AC 246 ms
85,600 KB
testcase_19 AC 245 ms
85,636 KB
testcase_20 AC 237 ms
85,452 KB
testcase_21 AC 240 ms
85,712 KB
testcase_22 AC 239 ms
85,624 KB
testcase_23 AC 241 ms
85,724 KB
testcase_24 AC 242 ms
85,408 KB
testcase_25 AC 239 ms
85,640 KB
testcase_26 AC 241 ms
85,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import statistics


N = int(input())

X = []
Y = []
for _ in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)

X.sort()
Y.sort()

a, b = statistics.median(X), statistics.median(Y)
a, b = int(a), int(b)

ans = 0
for x, y in zip(X, Y):
    ans += abs(x-a) + abs(y-b)

print(ans)
0