Submission #18843

#TimeUsernameProblemLanguageResultExecution timeMemory
18843ggohIdeal city (IOI12_city)C++98
0 / 100
12 ms7108 KiB
#include<cstdio> #include<map> #include<queue> int a,x,y,p,q,i,j,dx[]={1,0,-1,0},dy[]={0,1,0,-1}; long long sum,mod=1e9; std::map<int,int>m[100002]; std::queue<int>P,Q; int DistanceSum (int N, int *X, int *Y) { a=N; x=2147483647;y=2147483647; for(i=a-1;i>=0;i--)X[i+1]=X[i],Y[i+1]=Y[i]; for(i=1;i<=a;i++)x=std::min(x,X[i]),y=std::min(y,Y[i]); for(i=1;i<=a;i++)X[i]-=x,Y[i]-=y,m[X[i]][Y[i]]=i+1; return sum%mod; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...