Submission #1084838

# Submission time Handle Problem Language Result Execution time Memory
1084838 2024-09-07T05:42:16 Z Timosh Magic Show (APIO24_show) C++17
Compilation error
0 ms 0 KB
vector<pair<int, int>> Alice()
{
    vector<pair<int, int>> res;
    long long x = setN(5000);
    for (int i = 1; i <= 5000; i++)
    {
        if (i != x)
            res.push_back({i, x});
    }
    return res;
}
long long Bob(vector<pair<int, int>> V)
{
    int mx = 1;
    map<int, int> mp;
    for (auto &[x, y] : V)
    {
        mp[x]++;
        mp[y]++;
    }
    for (auto &[x, y] : mp)
    {
        if (mp[mx] < y)
            mx = x;
    }
    return mx;
}

Compilation message

Alice.cpp:1:1: error: 'vector' does not name a type
    1 | vector<pair<int, int>> Alice()
      | ^~~~~~

Bob.cpp:1:15: error: 'vector' was not declared in this scope
    1 | long long Bob(vector<pair<int, int>> V)
      |               ^~~~~~
Bob.cpp:1:22: error: 'pair' was not declared in this scope
    1 | long long Bob(vector<pair<int, int>> V)
      |                      ^~~~
Bob.cpp:1:27: error: expected primary-expression before 'int'
    1 | long long Bob(vector<pair<int, int>> V)
      |                           ^~~
Bob.cpp:1:32: error: expected primary-expression before 'int'
    1 | long long Bob(vector<pair<int, int>> V)
      |                                ^~~
Bob.cpp:1:39: error: expression list treated as compound expression in initializer [-fpermissive]
    1 | long long Bob(vector<pair<int, int>> V)
      |                                       ^