/ Vijos /

记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:56:28: error: no matching function for call to '__gcd(long long int&, long long unsigned int&)'
  cout<<ans2/__gcd(ans1,ans2)<<"/"<<ans1/__gcd(ans1,ans2)<<endl;
                            ^
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from foo.cc:1:
/usr/include/c++/7/bits/stl_algo.h:1232:5: note: candidate: template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)
     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
     ^~~~~
/usr/include/c++/7/bits/stl_algo.h:1232:5: note:   template argument deduction/substitution failed:
foo.cc:56:28: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long long int' and 'long long unsigned int')
  cout<<ans2/__gcd(ans1,ans2)<<"/"<<ans1/__gcd(ans1,ans2)<<endl;
                            ^
foo.cc:56:56: error: no matching function for call to '__gcd(long long int&, long long unsigned int&)'
  cout<<ans2/__gcd(ans1,ans2)<<"/"<<ans1/__gcd(ans1,ans2)<<endl;
                                                        ^
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from foo.cc:1:
/usr/include/c++/7/bits/stl_algo.h:1232:5: note: candidate: template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)
     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
     ^~~~~
/usr/include/c++/7/bits/stl_algo.h:1232:5: note:   template argument deduction/substitution failed:
foo.cc:56:56: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long long int' and 'long long unsigned int')
  cout<<ans2/__gcd(ans1,ans2)<<"/"<<ans1/__gcd(ans1,ans2)<<endl;
                                                        ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1286 座位安排
语言
C++
递交时间
2021-08-16 19:43:31
评测时间
2021-08-16 19:43:31
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes