QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#249208#7629. Make SYSU Great Again IIucup-team2045#Compile Error//C++14986b2023-11-12 02:02:282023-11-12 02:02:28

详细

answer.code: In function ‘void solve()’:
answer.code:32:102: error: no match for ‘operator=’ (operand types are ‘std::basic_ostream<char>::__ostream_type’ {aka ‘std::basic_ostream<char>’} and ‘long long int’)
   32 |         for (int j=0; j<n; j++) cout<<chk[i][j]=p[(i+j)%(m-1)]+m*p[(i-j+m-1+m-1)%(m-1)]<<" \n"[j+1==n];
      |                                                                                                      ^
In file included from /usr/include/c++/11/istream:39,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from answer.code:1:
/usr/include/c++/11/ostream:415:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]’
  415 |       operator=(basic_ostream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/11/ostream:415:33: note:   no known conversion for argument 1 from ‘long long int’ to ‘std::basic_ostream<char>&&’
  415 |       operator=(basic_ostream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~