Submission #487693

# Submission time Handle Problem Language Result Execution time Memory
487693 2021-11-16T12:11:34 Z Koosha_mv Ideal city (IOI12_city) C++14
0 / 100
17 ms 24396 KB
#include <bits/stdc++.h>
using namespace std;
#define erorp(x) cout<<#x<<"={"<<(x.F)<<" , "<<x.S<<"}"<<endl
#define print(v,r) f(i,0,r) cout<<v[i]<<" "; cout<<endl
#define eror(x) cout<<#x<<'='<<(x)<<endl
#define f_(i,a,b) for(int i=a;i>=b;i--)
#define f(i,a,b) for(int i=a;i<b;i++)
#define nb(x) __builtin_popcount(x)
#define maxm(a,b) a=max(a,b)
#define minm(a,b) a=min(a,b)
#define Add(x,y) x=(x+y)%mod
#define lst(x) x[x.size()-1]
#define sz(x) int(x.size())
#define mp make_pair
#define ll long long
#define pb push_back
#define S second
#define F first

const int N=1e6+99;

ll n,t,b[N],w[N];
pair<ll,ll> a[N];
vector<ll> g[N];
map<pair<ll,ll>,ll> edge,mark;
ll ans;

void solve(){
	f(i,0,n) b[i]=a[i].F;
	sort(b,b+n);
	f(i,1,n){
		if(a[i-1]!=a[i]){
			ans+=1ll*i*(n-i);
		}
	}
}
ll DistanceSum(int N,int *X,int *Y){
	n=N;
	f(i,0,n) a[i].F=X[i],a[i].S=Y[i];
	solve();
	f(i,0,n) a[i].F=Y[i],a[i].S=X[i];
	solve();
	return ans;
}

/*
2,5
v  = (2, 6), v  = (3, 3), v  = (3, 6), v  = (4, 3), v  = (4, 4), v  = (4, 5), v  = (4, 6), v  = (5, 3), v  = (5,
4), and v  = (5, 6)
11
2 5
2 6
3 3
3 6
4 3
4 4
4 5
4 6
5 3
5 4
5 6
*/
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 23756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 23756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 24396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 24396 KB Output isn't correct
2 Halted 0 ms 0 KB -