Submission #1043568

#TimeUsernameProblemLanguageResultExecution timeMemory
1043568MalixRail (IOI14_rail)C++14
30 / 100
33 ms604 KiB
#include "rail.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vii; typedef pair<int,int> pi; typedef vector<pi> pii; typedef tuple<int,int,int> tii; typedef vector<ll> li; typedef vector<li> lii; #define REP(i,a,b) for(int i=a;i<b;i++) #define F first #define S second #define PB push_back #define MP make_pair #define LSOne(s) ((s)&(-s)) ll INF=1e18+10; int inf=1e9+10; ll M=1e9+7; void findLocation(int n, int m, int location[], int stype[]) { vi t(n,2),loc(n,-1); t[0]=1;loc[0]=m; REP(i,1,n){ int k=getDistance(0,i); loc[i]=loc[0]+k; } int pos=0,d=inf; REP(i,1,n)if(loc[i]<d){ pos=i;d=loc[i]; } REP(i,1,n){ if(i==pos)continue; int k=getDistance(i,pos); if(k<loc[i]-m){ loc[i]=m-(k-loc[pos]+m); t[i]=1; } } REP(i,0,n)stype[i]=t[i]; REP(i,0,n)location[i]=loc[i]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...