結果

問題 No.2315 Flying Camera
ユーザー KudeKude
提出日時 2023-05-26 21:23:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 71,228 KB
最終ジャッジ日時 2023-08-26 09:52:10
合計ジャッジ時間 3,478 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,100 KB
testcase_01 AC 66 ms
70,908 KB
testcase_02 AC 65 ms
70,984 KB
testcase_03 AC 66 ms
70,980 KB
testcase_04 AC 68 ms
71,176 KB
testcase_05 AC 66 ms
71,036 KB
testcase_06 AC 66 ms
71,132 KB
testcase_07 AC 67 ms
71,092 KB
testcase_08 AC 65 ms
70,976 KB
testcase_09 AC 69 ms
70,984 KB
testcase_10 AC 65 ms
71,140 KB
testcase_11 AC 65 ms
71,104 KB
testcase_12 AC 68 ms
70,980 KB
testcase_13 AC 67 ms
71,104 KB
testcase_14 AC 67 ms
71,228 KB
testcase_15 AC 66 ms
71,136 KB
testcase_16 AC 66 ms
71,072 KB
testcase_17 AC 64 ms
71,148 KB
testcase_18 AC 68 ms
71,136 KB
testcase_19 AC 68 ms
70,976 KB
testcase_20 AC 65 ms
70,908 KB
testcase_21 AC 67 ms
71,032 KB
testcase_22 AC 63 ms
71,100 KB
testcase_23 AC 62 ms
70,980 KB
testcase_24 AC 67 ms
71,100 KB
testcase_25 AC 64 ms
71,060 KB
testcase_26 AC 66 ms
71,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
x, y = [], []
for _ in range(n):
    xi, yi = map(int, input().split())
    x.append(xi)
    y.append(yi)
x.sort()
y.sort()
xc, yc = x[n // 2], y[n // 2]
ans = sum(abs(xi - xc) for xi in x) + sum(abs(yi - yc) for yi in y)
print(ans)
0