Submission #16369

#TimeUsernameProblemLanguageResultExecution timeMemory
16369suhgyuho_williamComputer Network (BOI14_network)C++98
50 / 100
153 ms5200 KiB
#include "network.h" #include <map> using namespace std; map<int,int> mp; map<int,int>::iterator it,t1,t2; bool check[1002]; void findRoute (int n, int a, int b) { int dist = ping(a, b); int i,x,y,t; mp[dist+1]=b; check[dist+1]=1; mp[0]=a; check[0]=1; for(i=1;i<=n;i++){ if(i==a || i==b) continue; x=ping(a,i); if(x >= dist) continue; if(check[x+1]) continue; mp[x+1]=i; it=mp.find(x+1); t1=it; t1--; t=ping(t1->second,i); t2=it; t2++; y=ping(i,t2->second); if(t+y+2 != t2->first - t1->first){ mp.erase(it); }else{ check[x+1]=1; } } for(it=(++mp.begin()); it!=mp.end(); it++){ travelTo(it->second); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...