답안 #1011010

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1011010 2024-06-29T16:56:48 Z ttamx 마술쇼 (APIO24_show) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "Alice.h"

using namespace std;

vector<pair<int,int>> Alice(){
    int n=200;
    long long x=setN(n);
    vector<pair<int,int>> res;
    for(int i=1;i<n;i++)res.emplace_back(x%i+1,i+1);
    return res;
}
#include <bits/stdc++.h>
#include "Bob.h"

using namespace std;

using i128 = __int128_t;

long long Bob(vector<pair<int,int>> e){
    const i128 LIM=1e18;
    i128 a=0,m=0;
    for(auto [u,v]:e){
        if(m>LIM)break;
        u--,v--;
        if(u>v)swap(u,v);
        if(m==0){
            a=u,m=v;
            continue;
        }
        while(a%v!=u)a+=m;
        m=m*v/gcd(m,v);
    }
    return a;
}

Compilation message

In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:84,
                 from Bob.cpp:1:
/usr/include/c++/10/numeric: In instantiation of 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = __int128; _Nn = int; std::common_type_t<_Mn, _Nn> = __int128]':
Bob.cpp:20:22:   required from here
/usr/include/c++/10/numeric:133:21: error: static assertion failed: gcd arguments are integers
  133 |       static_assert(is_integral_v<_Mn>, "gcd arguments are integers");
      |                     ^~~~~~~~~~~~~~~~~~
/usr/include/c++/10/numeric: In instantiation of 'constexpr std::common_type_t<_Mn, _Nn> std::__detail::__gcd(_Mn, _Nn) [with _Mn = __int128; _Nn = int; std::common_type_t<_Mn, _Nn> = __int128]':
/usr/include/c++/10/numeric:139:29:   required from 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = __int128; _Nn = int; std::common_type_t<_Mn, _Nn> = __int128]'
Bob.cpp:20:22:   required from here
/usr/include/c++/10/numeric:105:39: error: use of deleted function 'void std::__detail::__abs_integral(bool)'
  105 |  : __n == 0 ? __detail::__abs_integral(__m)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/10/numeric:98:8: note: declared here
   98 |   void __abs_integral(bool) = delete;
      |        ^~~~~~~~~~~~~~
/usr/include/c++/10/numeric: In instantiation of 'constexpr std::common_type_t<_Mn, _Nn> std::__detail::__gcd(_Mn, _Nn) [with _Mn = int; _Nn = __int128; std::common_type_t<_Mn, _Nn> = __int128]':
/usr/include/c++/10/numeric:106:19:   required from 'constexpr std::common_type_t<_Mn, _Nn> std::__detail::__gcd(_Mn, _Nn) [with _Mn = __int128; _Nn = int; std::common_type_t<_Mn, _Nn> = __int128]'
/usr/include/c++/10/numeric:139:29:   required from 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = __int128; _Nn = int; std::common_type_t<_Mn, _Nn> = __int128]'
Bob.cpp:20:22:   required from here
/usr/include/c++/10/numeric:104:49: error: use of deleted function 'void std::__detail::__abs_integral(bool)'
  104 |       return __m == 0 ? __detail::__abs_integral(__n)
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/10/numeric:98:8: note: declared here
   98 |   void __abs_integral(bool) = delete;
      |        ^~~~~~~~~~~~~~
/usr/include/c++/10/numeric: In instantiation of 'constexpr std::common_type_t<_Mn, _Nn> std::__detail::__gcd(_Mn, _Nn) [with _Mn = __int128; _Nn = __int128; std::common_type_t<_Mn, _Nn> = __int128]':
/usr/include/c++/10/numeric:106:19:   recursively required from 'constexpr std::common_type_t<_Mn, _Nn> std::__detail::__gcd(_Mn, _Nn) [with _Mn = int; _Nn = __int128; std::common_type_t<_Mn, _Nn> = __int128]'
/usr/include/c++/10/numeric:106:19:   required from 'constexpr std::common_type_t<_Mn, _Nn> std::__detail::__gcd(_Mn, _Nn) [with _Mn = __int128; _Nn = int; std::common_type_t<_Mn, _Nn> = __int128]'
/usr/include/c++/10/numeric:139:29:   required from 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = __int128; _Nn = int; std::common_type_t<_Mn, _Nn> = __int128]'
Bob.cpp:20:22:   required from here
/usr/include/c++/10/numeric:104:49: error: use of deleted function 'void std::__detail::__abs_integral(bool)'
  104 |       return __m == 0 ? __detail::__abs_integral(__n)
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/10/numeric:98:8: note: declared here
   98 |   void __abs_integral(bool) = delete;
      |        ^~~~~~~~~~~~~~
/usr/include/c++/10/numeric:105:39: error: use of deleted function 'void std::__detail::__abs_integral(bool)'
  105 |  : __n == 0 ? __detail::__abs_integral(__m)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/10/numeric:98:8: note: declared here
   98 |   void __abs_integral(bool) = delete;
      |        ^~~~~~~~~~~~~~