Submission #16367

#TimeUsernameProblemLanguageResultExecution timeMemory
16367suhgyuho_williamComputer Network (BOI14_network)C++98
25 / 100
135 ms5200 KiB
#include "network.h" #include <map> using namespace std; map<int,int> mp; map<int,int>::iterator it; void findRoute (int n, int a, int b) { int dist = ping(a, b); int x,y; int i; mp[dist+1]=b; for(i=1;i<=n;i++){ if(i==a || i==b) continue; x=ping(a,i); if(x>=dist) continue; if(mp.find(x+1)!=mp.end()) continue; mp[x+1]=i; it=mp.find(x+1); it++; y=ping(i,it->second); if(it->first != (x+1) + (y+1) ){ mp.erase(x+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...