QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#597439#9347. Competition in Swiss-systemMaMengQiCompile Error//C++202.9kb2024-09-28 17:49:332024-09-28 17:49:34

详细

answer.code: In member function ‘constexpr fact fact::operator+(const fact&) const’:
answer.code:14:20: warning: invalid return type ‘fact’ of ‘constexpr’ function ‘constexpr fact fact::operator+(const fact&) const’ [-Winvalid-constexpr]
   14 |     constexpr fact operator+(const fact &o) const { return fact(p * o.q + q * o.p, q * o.q); }
      |                    ^~~~~~~~
answer.code:5:8: note: ‘fact’ is not literal because:
    5 | struct fact
      |        ^~~~
answer.code:5:8: note:   ‘fact’ is not an aggregate, does not have a trivial default constructor, and has no ‘constexpr’ constructor that is not a copy or move constructor
answer.code: In member function ‘constexpr fact fact::operator-(const fact&) const’:
answer.code:15:20: warning: invalid return type ‘fact’ of ‘constexpr’ function ‘constexpr fact fact::operator-(const fact&) const’ [-Winvalid-constexpr]
   15 |     constexpr fact operator-(const fact &o) const { return fact(p * o.q - q * o.p, q * o.q); }
      |                    ^~~~~~~~
answer.code: In member function ‘constexpr fact fact::operator*(const fact&) const’:
answer.code:16:20: warning: invalid return type ‘fact’ of ‘constexpr’ function ‘constexpr fact fact::operator*(const fact&) const’ [-Winvalid-constexpr]
   16 |     constexpr fact operator*(const fact &o) const { return fact(p * o.p, q * o.q); }
      |                    ^~~~~~~~
answer.code: In member function ‘constexpr fact fact::operator/(const fact&) const’:
answer.code:17:20: warning: invalid return type ‘fact’ of ‘constexpr’ function ‘constexpr fact fact::operator/(const fact&) const’ [-Winvalid-constexpr]
   17 |     constexpr fact operator/(const fact &o) const { return fact(p * o.q, q * o.p); }
      |                    ^~~~~~~~
answer.code: In member function ‘constexpr fact& fact::operator+=(const fact&)’:
answer.code:18:70: warning: temporary of non-literal type ‘fact’ in a constant expression [-Winvalid-constexpr]
   18 |     constexpr fact& operator+=(const fact &o) { return *this = *this + o; }
      |                                                                ~~~~~~^~~
answer.code: In member function ‘constexpr fact& fact::operator-=(const fact&)’:
answer.code:19:70: warning: temporary of non-literal type ‘fact’ in a constant expression [-Winvalid-constexpr]
   19 |     constexpr fact& operator-=(const fact &o) { return *this = *this - o; }
      |                                                                ~~~~~~^~~
answer.code: In member function ‘constexpr fact& fact::operator*=(const fact&)’:
answer.code:20:70: warning: temporary of non-literal type ‘fact’ in a constant expression [-Winvalid-constexpr]
   20 |     constexpr fact& operator*=(const fact &o) { return *this = *this * o; }
      |                                                                ~~~~~~^~~
answer.code: In member function ‘constexpr fact& fact::operator/=(const fact&)’:
answer.code:21:70: warning: temporary of non-literal type ‘fact’ in a constant expression [-Winvalid-constexpr]
   21 |     constexpr fact& operator/=(const fact &o) { return *this = *this / o; }
      |                                                                ~~~~~~^~~
answer.code: In function ‘void solve()’:
answer.code:78:31: error: no matching function for call to ‘max(long long unsigned int, std::vector<int>::size_type)’
   78 |             omw[j] /= std::max(1llu, oppo[j].size());
      |                       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
answer.code:78:31: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long long unsigned int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’})
   78 |             omw[j] /= std::max(1llu, oppo[j].size());
      |                       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note:   template argument deduction/substitution failed:
answer.code:78:31: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long long unsigned int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’})
   78 |             omw[j] /= std::max(1llu, oppo[j].size());
      |                       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: ‘templat...