Submission #1293575

#TimeUsernameProblemLanguageResultExecution timeMemory
1293575sh1kaMagic Show (APIO24_show)C++20
Compilation error
0 ms0 KiB
#include "Alice.h" #include <bits/stdc++.h> using namespace std; vector<pair<int, int>> Alice() { // #define int int64_t long long X = setN(5000); vector<pair<int, int>> res; for (int64_t i = 1; i < 5000; i++) { res.push_back({X%i + 1, i + 1}); } return res; }
#include "Bob.h" #include <bits/stdc++.h> using namespace std; int gcd_r(__int128_t a, __int128_t b, __int128_t &x, __int128_t &y) { if (b == 0) { x = 1, y = 0; return a; } __int128_t g = gcd(b, a%b, x, y); __int128_t xp = y; __int128_t yp = x - y * (a / b); x = xp, y = yp; return g; } long long Bob(vector<pair<__int128_t, __int128_t>> v) { while (v.size() >= 2) { auto [r1, a1] = v.back(); v.pop_back(); auto [r2, a2] = v.back(); v.pop_back(); __int128_t gg = __gcd(a1, a2); a1 /= gg; a2 /= gg; r1 %= a1; r2 %= a2; __int128_t x, y; gg = gcd(a1, a2, x, y); y *= -1; x *= r2 - r1; y *= r2 - r1; v.push_back({a1 * x + r1, a1 * a2}); } return v.back().first(); }

Compilation message (stderr)

# 2번째 컴파일 단계

Bob.cpp: In function 'int gcd_r(__int128, __int128, __int128&, __int128&)':
Bob.cpp:11:23: error: no matching function for call to 'gcd(__int128&, __int128, __int128&, __int128&)'
   11 |     __int128_t g = gcd(b, a%b, x, y);
      |                    ~~~^~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:58,
                 from Bob.cpp:2:
/usr/include/c++/13/numeric:164:5: note: candidate: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Tp1, _Tp2> std::gcd(_Mn, _Nn)'
  164 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
/usr/include/c++/13/numeric:164:5: note:   template argument deduction/substitution failed:
Bob.cpp:11:23: note:   candidate expects 2 arguments, 4 provided
   11 |     __int128_t g = gcd(b, a%b, x, y);
      |                    ~~~^~~~~~~~~~~~~~
Bob.cpp: In function 'long long int Bob(std::vector<std::pair<__int128, __int128> >)':
Bob.cpp:34:17: error: no matching function for call to 'gcd(std::tuple_element<1, std::pair<__int128, __int128> >::type&, std::tuple_element<1, std::pair<__int128, __int128> >::type&, __int128&, __int128&)'
   34 |         gg = gcd(a1, a2, x, y);
      |              ~~~^~~~~~~~~~~~~~
/usr/include/c++/13/numeric:164:5: note: candidate: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Tp1, _Tp2> std::gcd(_Mn, _Nn)'
  164 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
/usr/include/c++/13/numeric:164:5: note:   template argument deduction/substitution failed:
Bob.cpp:34:17: note:   candidate expects 2 arguments, 4 provided
   34 |         gg = gcd(a1, a2, x, y);
      |              ~~~^~~~~~~~~~~~~~
Bob.cpp:42:26: error: expression cannot be used as a function
   42 |     return v.back().first();
      |            ~~~~~~~~~~~~~~^~