# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1207351 | wazj2024 | Traffic (IOI10_traffic) | C++20 | 0 ms | 0 KiB |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int LocateCentre(int N, int pp[], int S[], int D[]) {
int bestCity = -1;
int minMaxCongestion = 2000000;
for (int i = 0; i < N; i++) {
int maxCongestion = 0;
for (int i = 0; i < N; i++) {
if (i != i) {
int pathCongestion = P[i];
maxCongestion = max(maxCongestion, pathCongestion);
}
}
if (maxCongestion<minMaxCongestion) {
minMaxCongestion=maxCongestion;
bestCity=i;
}
}
return bestCity;
}