# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
207274 | 2020-03-07T00:14:18 Z | AQT | Towns (IOI15_towns) | C++14 | 28 ms | 380 KB |
#include <towns.h> #include <bits/stdc++.h> using namespace std; int dist[2][200]; int hubDistance(int N, int sub){ int d1 = 0, d2 = 0; for(int i = 1; i<N; i++){ dist[0][i] = getDistance(0, i); if(dist[0][i] > dist[0][d1]){ d1 = i; } } for(int i = 0; i<N; i++){ dist[1][i] = getDistance(d1, i); if(dist[1][i] > dist[1][d2]){ d2 = i; } } int dia = dist[1][d2]; int ans = 0; for(int i = 0; i<N; i++){ int k = (dist[0][d1] + dist[1][i] - dist[0][i])/2; if(abs(ans-dia/2) > abs(k-dia/2)){ ans = k; } } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 24 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 20 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 26 ms | 376 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 28 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 21 ms | 380 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |