結果

問題 No.2315 Flying Camera
ユーザー ShirotsumeShirotsume
提出日時 2023-05-26 21:42:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 440 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 71,836 KB
最終ジャッジ日時 2023-08-26 10:54:47
合計ジャッジ時間 4,151 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,600 KB
testcase_01 AC 90 ms
71,316 KB
testcase_02 AC 93 ms
71,572 KB
testcase_03 AC 91 ms
71,828 KB
testcase_04 AC 92 ms
71,532 KB
testcase_05 AC 92 ms
71,596 KB
testcase_06 AC 90 ms
71,604 KB
testcase_07 AC 91 ms
71,516 KB
testcase_08 AC 91 ms
71,836 KB
testcase_09 AC 92 ms
71,604 KB
testcase_10 AC 91 ms
71,476 KB
testcase_11 AC 93 ms
71,528 KB
testcase_12 AC 92 ms
71,640 KB
testcase_13 AC 93 ms
71,456 KB
testcase_14 AC 95 ms
71,640 KB
testcase_15 AC 93 ms
71,516 KB
testcase_16 AC 91 ms
71,788 KB
testcase_17 AC 91 ms
71,788 KB
testcase_18 AC 92 ms
71,456 KB
testcase_19 AC 93 ms
71,460 KB
testcase_20 AC 92 ms
71,744 KB
testcase_21 AC 94 ms
71,568 KB
testcase_22 AC 91 ms
71,636 KB
testcase_23 AC 94 ms
71,788 KB
testcase_24 AC 96 ms
71,704 KB
testcase_25 AC 92 ms
71,704 KB
testcase_26 AC 95 ms
71,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

n = ii()

x = []
y = []

for i in range(n):
    a, b = mi()
    x.append(a)
    y.append(b)

x.sort()
y.sort()

xx = x[n//2]
yy = y[n//2]

ans = 0

for i in range(n):
    ans += abs(xx - x[i]) + abs(yy - y[i])
print(ans)
0