結果
問題 |
No.2315 Flying Camera
|
ユーザー |
![]() |
提出日時 | 2023-05-27 00:25:26 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 113 ms / 2,000 ms |
コード長 | 739 bytes |
コンパイル時間 | 2,289 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 80,512 KB |
最終ジャッジ日時 | 2024-12-25 11:54:16 |
合計ジャッジ時間 | 5,051 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
from collections import defaultdict, deque, Counter import copy from itertools import combinations, permutations, product, accumulate, groupby from heapq import heapify, heappop, heappush import math import bisect from pprint import pprint from random import randint import sys # sys.setrecursionlimit(700000) input = lambda: sys.stdin.readline().rstrip('\n') inf = float('inf') mod1 = 10**9+7 mod2 = 998244353 def ceil_div(x, y): return -(-x//y) ################################################# N = int(input()) X, Y = [], [] for _ in range(N): x, y = map(int, input().split()) X.append(x) Y.append(y) X.sort() ax = X[(N-1)//2] Y.sort() ay = Y[(N-1)//2] s = 0 for x in X: s += abs(ax-x) for y in Y: s += abs(ay-y) print(s)