Submission #60283650


Source Code Expand

#include<bits/stdc++.h>
#include"atcoder/all"
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll inf=1ll<<61;
typedef modint998244353 mi;

ll x[100005],y[100005];

int main(){
	int n;cin>>n;
	rep(i,n)cin>>x[i]>>y[i];
	sort(x,x+n);
	sort(y,y+n);
	ll ans=0;
	rep(i,n){
		ans+=abs(x[i]-x[n/2]);
		ans+=abs(y[i]-y[n/2]);
	}
	cout<<ans<<endl;
}

Submission Info

Submission Time
Task 070 - Plant Planning(★4)
User Rho17
Language C++ 20 (gcc 12.2)
Score 4
Code Size 535 Byte
Status AC
Exec Time 66 ms
Memory 5264 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 4 / 4
Status
AC × 4
AC × 23
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 10_small_random_01.txt, 10_small_random_02.txt, 10_small_random_03.txt, 10_small_random_04.txt, 10_small_random_05.txt, 10_small_random_06.txt, 10_small_random_07.txt, 10_small_random_08.txt, 10_small_random_09.txt, 50_large_random_01.txt, 50_large_random_02.txt, 50_large_random_03.txt, 50_large_random_04.txt, 50_large_random_05.txt, 60_x_axis_01.txt, 60_y_axis_01.txt, 70_corner_points_01.txt, 70_single_point_01.txt, 70_upper_right_01.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 7 ms 3408 KiB
00_sample_02.txt AC 1 ms 3580 KiB
00_sample_03.txt AC 2 ms 3440 KiB
00_sample_04.txt AC 1 ms 3436 KiB
10_small_random_01.txt AC 1 ms 3708 KiB
10_small_random_02.txt AC 1 ms 3504 KiB
10_small_random_03.txt AC 1 ms 3588 KiB
10_small_random_04.txt AC 1 ms 3496 KiB
10_small_random_05.txt AC 1 ms 3564 KiB
10_small_random_06.txt AC 1 ms 3468 KiB
10_small_random_07.txt AC 1 ms 3516 KiB
10_small_random_08.txt AC 1 ms 3512 KiB
10_small_random_09.txt AC 1 ms 3436 KiB
50_large_random_01.txt AC 66 ms 5140 KiB
50_large_random_02.txt AC 64 ms 5080 KiB
50_large_random_03.txt AC 64 ms 5092 KiB
50_large_random_04.txt AC 64 ms 4996 KiB
50_large_random_05.txt AC 65 ms 5264 KiB
60_x_axis_01.txt AC 43 ms 5064 KiB
60_y_axis_01.txt AC 43 ms 5088 KiB
70_corner_points_01.txt AC 59 ms 5092 KiB
70_single_point_01.txt AC 54 ms 5088 KiB
70_upper_right_01.txt AC 59 ms 5144 KiB