Submission #1321052

#TimeUsernameProblemLanguageResultExecution timeMemory
1321052sadixSouvenirs (IOI25_souvenirs)C++17
Compilation error
0 ms0 KiB
void buy_souvenirs(int N, long long P0) {
    vector<long long> bestM(N, -1);

    for (long long M = 1; M < P0; M++) {
        auto res = transaction(M);
        for (int t : res.first) {
            if (bestM[t] == -1)
                bestM[t] = M;
        }
    }

    for (int i = 1; i < N; i++) {
        for (int cnt = 0; cnt < i; cnt++) {
            transaction(bestM[i]);
        }
    }
}

Compilation message (stderr)

souvenirs.cpp: In function 'void buy_souvenirs(int, long long int)':
souvenirs.cpp:2:5: error: 'vector' was not declared in this scope
    2 |     vector<long long> bestM(N, -1);
      |     ^~~~~~
souvenirs.cpp:2:12: error: expected primary-expression before 'long'
    2 |     vector<long long> bestM(N, -1);
      |            ^~~~
souvenirs.cpp:5:20: error: 'transaction' was not declared in this scope
    5 |         auto res = transaction(M);
      |                    ^~~~~~~~~~~
souvenirs.cpp:7:17: error: 'bestM' was not declared in this scope
    7 |             if (bestM[t] == -1)
      |                 ^~~~~
souvenirs.cpp:14:25: error: 'bestM' was not declared in this scope
   14 |             transaction(bestM[i]);
      |                         ^~~~~
souvenirs.cpp:14:13: error: 'transaction' was not declared in this scope
   14 |             transaction(bestM[i]);
      |             ^~~~~~~~~~~