QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#46106#4584. Not OneGuanYunchangCompile Error//C++173.3kb2022-08-25 22:01:522022-08-25 22:01:53

Details

answer.code: In function ‘void Union(long long int, long long int)’:
answer.code:122:5: error: reference to ‘gcd’ is ambiguous
  122 |     gcd[a] = __gcd(gcd[a], gcd[b]);
      |     ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:84,
                 from answer.code:1:
/usr/include/c++/11/numeric:167:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)’
  167 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:107:17: note:                 ‘long long int gcd [100005]’
  107 | int arr[100005],gcd[100005],parent[100005];
      |                 ^~~
answer.code:122:20: error: reference to ‘gcd’ is ambiguous
  122 |     gcd[a] = __gcd(gcd[a], gcd[b]);
      |                    ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:84,
                 from answer.code:1:
/usr/include/c++/11/numeric:167:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)’
  167 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:107:17: note:                 ‘long long int gcd [100005]’
  107 | int arr[100005],gcd[100005],parent[100005];
      |                 ^~~
answer.code:122:28: error: reference to ‘gcd’ is ambiguous
  122 |     gcd[a] = __gcd(gcd[a], gcd[b]);
      |                            ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:84,
                 from answer.code:1:
/usr/include/c++/11/numeric:167:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)’
  167 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:107:17: note:                 ‘long long int gcd [100005]’
  107 | int arr[100005],gcd[100005],parent[100005];
      |                 ^~~
answer.code: In function ‘void solve()’:
answer.code:132:9: error: reference to ‘gcd’ is ambiguous
  132 |         gcd[i] = arr[i];
      |         ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:84,
                 from answer.code:1:
/usr/include/c++/11/numeric:167:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)’
  167 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:107:17: note:                 ‘long long int gcd [100005]’
  107 | int arr[100005],gcd[100005],parent[100005];
      |                 ^~~
answer.code:140:30: error: reference to ‘gcd’ is ambiguous
  140 |         if(p1 != p2 && __gcd(gcd[p1] , gcd[p2]) != 1)
      |                              ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:84,
                 from answer.code:1:
/usr/include/c++/11/numeric:167:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)’
  167 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:107:17: note:                 ‘long long int gcd [100005]’
  107 | int arr[100005],gcd[100005],parent[100005];
      |                 ^~~
answer.code:140:40: error: reference to ‘gcd’ is ambiguous
  140 |         if(p1 != p2 && __gcd(gcd[p1] , gcd[p2]) != 1)
      |                                        ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:84,
                 from answer.code:1:
/usr/include/c++/11/numeric:167:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)’
  167 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:107:17: note:                 ‘long long int gcd [100005]’
  107 | int arr[100005],gcd[100005],parent[100005];
      |                 ^~~
answer.code:147:29: error: reference to ‘gcd’ is ambiguous
  147 |         if(parent[i] < 0 && gcd[i] != 1)
      |                             ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:84,
                 from answer.code:1:
/usr/include/c++/11/numeric:167:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)’
  167 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:107:17: note:                 ‘long long int gcd [100005]’
  107 | int arr[100005],gcd[100005],parent[100005];
      |                 ^~~