Submission #703278

# Submission time Handle Problem Language Result Execution time Memory
703278 2023-02-26T21:11:10 Z finn__ Archery (IOI09_archery) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

#define N 200000

unsigned rank[N << 1];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    size_t n, r;
    cin >> n >> r;

    for (size_t i = 0; i < 2 * n; i++)
        cin >> rank[i];

    if (rank[0] == 1)
    {
        cout << 1 << '\n';
    }
}

Compilation message

archery.cpp: In function 'int main()':
archery.cpp:17:16: error: reference to 'rank' is ambiguous
   17 |         cin >> rank[i];
      |                ^~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/stl_pair.h:59,
                 from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from archery.cpp:1:
/usr/include/c++/10/type_traits:1359:12: note: candidates are: 'template<class> struct std::rank'
 1359 |     struct rank
      |            ^~~~
archery.cpp:6:10: note:                 'unsigned int rank [400000]'
    6 | unsigned rank[N << 1];
      |          ^~~~
archery.cpp:19:9: error: reference to 'rank' is ambiguous
   19 |     if (rank[0] == 1)
      |         ^~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/stl_pair.h:59,
                 from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from archery.cpp:1:
/usr/include/c++/10/type_traits:1359:12: note: candidates are: 'template<class> struct std::rank'
 1359 |     struct rank
      |            ^~~~
archery.cpp:6:10: note:                 'unsigned int rank [400000]'
    6 | unsigned rank[N << 1];
      |          ^~~~