# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151888 | 2019-09-05T10:05:40 Z | Ruxandra985 | Computer Network (BOI14_network) | C++14 | 113 ms | 4316 KB |
#include <cstdio> #include "network.h" void findRoute (int n,int a,int b){ int da[n+1],db[n+1]; int i,curr,x,y,nxt; for (i=1;i<=n;i++){ da[i] = db[i] = -2; } curr = a; x = -1; da[b] = db[a] = ping(a,b); y = da[b]; while (curr!=b){ int more = 0; for (i=1;i<=n;i++){ if (i!=curr){ if (da[i] == -2) da[i] = ping(a,i); if (da[i] == x + 1){ if (i == b) db[i] = -1; else { if (db[i] == -2) db[i] = ping(i,b); } if (y-1 == db[i]){ if (!more) nxt = i; else { if (curr == a || ping(curr,nxt)==0) break; else nxt = i; } more = 1; } } } } travelTo(nxt); curr = nxt; x++; y--; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 113 ms | 4316 KB | ping called with invalid arguments |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 104 ms | 4216 KB | ping called with invalid arguments |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 104 ms | 4312 KB | ping called with invalid arguments |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 104 ms | 4216 KB | ping called with invalid arguments |
2 | Halted | 0 ms | 0 KB | - |