Submission #1252904

#TimeUsernameProblemLanguageResultExecution timeMemory
1252904kkzyrSouvenirs (IOI25_souvenirs)C++20
Compilation error
0 ms0 KiB
void buy_souvenirs(int N, long long P0){
    long long nxt = P0 - 1;
    int how_many_last = 0;
    for (int i = 1;i < N;i++){
        pair<vector<int>, long long> result;
        result = transaction(nxt);
        if (i == N - 1){
            for (int j = 1;j < (i - how_many_last);j++){
                transaction(nxt);
            }
        }
        else{
            for (int j = 1;j < i;j++){
                transaction(nxt);
            }
        }
        if (result.first.size() == 1 and result.second == 0 and result.first[0] == i){
            nxt--;
        }
        else{
            if (result.first.size() == 2){
                how_many_last++;
            }
            nxt -= 2;
        }
    }
}

Compilation message (stderr)

souvenirs.cpp: In function 'void buy_souvenirs(int, long long int)':
souvenirs.cpp:5:14: error: 'vector' was not declared in this scope
    5 |         pair<vector<int>, long long> result;
      |              ^~~~~~
souvenirs.cpp:5:9: error: 'pair' was not declared in this scope
    5 |         pair<vector<int>, long long> result;
      |         ^~~~
souvenirs.cpp:5:21: error: expected primary-expression before 'int'
    5 |         pair<vector<int>, long long> result;
      |                     ^~~
souvenirs.cpp:6:9: error: 'result' was not declared in this scope
    6 |         result = transaction(nxt);
      |         ^~~~~~
souvenirs.cpp:6:18: error: 'transaction' was not declared in this scope
    6 |         result = transaction(nxt);
      |                  ^~~~~~~~~~~