Submission #1207351

#TimeUsernameProblemLanguageResultExecution timeMemory
1207351wazj2024Traffic (IOI10_traffic)C++20
Compilation error
0 ms0 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;
}

Compilation message (stderr)

traffic.cpp: In function 'int LocateCentre(int, int*, int*, int*)':
traffic.cpp:12:38: error: 'P' was not declared in this scope
   12 |                 int pathCongestion = P[i];
      |                                      ^