QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#852328#9738. Make It Divisibleucup-team3625#Compile Error//C++203.1kb2025-01-11 11:23:552025-01-11 11:23:56

Details

answer.code: In function ‘void BuildGCD()’:
answer.code:14:35: error: reference to ‘gcd’ is ambiguous
   14 |     for (int i = 1; i <= m; ++ i) gcd[0][i] = b[i];
      |                                   ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:58,
                 from answer.code:2:
/usr/include/c++/13/numeric:164:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Tp1, _Tp2> std::gcd(_Mn, _Nn)’
  164 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:11:45: note:                 ‘int gcd [17][50005]’
   11 | int n, m, k, a[O], b[O], L[O], R[O], lg[O], gcd[lim + 1][O];
      |                                             ^~~
answer.code:17:13: error: reference to ‘gcd’ is ambiguous
   17 |             gcd[i][j] = __gcd(gcd[i - 1][j], gcd[i - 1][j + (1 << (i - 1))]);
      |             ^~~
/usr/include/c++/13/numeric:164:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Tp1, _Tp2> std::gcd(_Mn, _Nn)’
  164 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:11:45: note:                 ‘int gcd [17][50005]’
   11 | int n, m, k, a[O], b[O], L[O], R[O], lg[O], gcd[lim + 1][O];
      |                                             ^~~
answer.code:17:31: error: reference to ‘gcd’ is ambiguous
   17 |             gcd[i][j] = __gcd(gcd[i - 1][j], gcd[i - 1][j + (1 << (i - 1))]);
      |                               ^~~
/usr/include/c++/13/numeric:164:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Tp1, _Tp2> std::gcd(_Mn, _Nn)’
  164 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:11:45: note:                 ‘int gcd [17][50005]’
   11 | int n, m, k, a[O], b[O], L[O], R[O], lg[O], gcd[lim + 1][O];
      |                                             ^~~
answer.code:17:46: error: reference to ‘gcd’ is ambiguous
   17 |             gcd[i][j] = __gcd(gcd[i - 1][j], gcd[i - 1][j + (1 << (i - 1))]);
      |                                              ^~~
/usr/include/c++/13/numeric:164:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Tp1, _Tp2> std::gcd(_Mn, _Nn)’
  164 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:11:45: note:                 ‘int gcd [17][50005]’
   11 | int n, m, k, a[O], b[O], L[O], R[O], lg[O], gcd[lim + 1][O];
      |                                             ^~~
answer.code: In function ‘int Get(int, int)’:
answer.code:24:18: error: reference to ‘gcd’ is ambiguous
   24 |     return __gcd(gcd[len][l], gcd[len][r - (1 << len) + 1]);
      |                  ^~~
/usr/include/c++/13/numeric:164:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Tp1, _Tp2> std::gcd(_Mn, _Nn)’
  164 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:11:45: note:                 ‘int gcd [17][50005]’
   11 | int n, m, k, a[O], b[O], L[O], R[O], lg[O], gcd[lim + 1][O];
      |                                             ^~~
answer.code:24:31: error: reference to ‘gcd’ is ambiguous
   24 |     return __gcd(gcd[len][l], gcd[len][r - (1 << len) + 1]);
      |                               ^~~
/usr/include/c++/13/numeric:164:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_type_t<_Tp1, _Tp2> std::gcd(_Mn, _Nn)’
  164 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
answer.code:11:45: note:                 ‘int gcd [17][50005]’
   11 | int n, m, k, a[O], b[O], L[O], R[O], lg[O], gcd[lim + 1][O];
      |                                             ^~~
answer.code: At global scope:
answer.code:27:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
   27 | main(){
      | ^~~~
answer.code: In function ‘int main()’:
answer.code:30:16: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   30 |         freopen("input.in", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
answer.code:31:16: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   31 |         freopen("output.out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~