QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#370705#8224. Caught in the MiddleNetwork_ErrorCompile Error//C++20533b2024-03-29 15:29:092024-03-29 15:30:15

Judging History

你现在查看的是最新测评结果

  • [2024-03-29 15:30:15]
  • 评测
  • [2024-03-29 15:29:09]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define piii tuple<int,int,int>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define deb(var) cerr<<#var<<'='<<(var)<<"; "
#define int long long
char c[1000010];
void work(){
	cin>>(c+1);
	int n=strlen(c+1);
	if(c[1]='L'||c[n]=='R')cout<<"Alice\n";
	else cout<<"Bob\n";
}
signed main(){
	ios::sync_with_stdio(0),
	cin.tie(0),cout.tie(0);
	int T=1;cin>>T;while(T--)work();return 0;
}


Details

answer.code: In function ‘void work()’:
answer.code:14:12: error: no match for ‘operator>>’ (operand types are ‘std::istream’ {aka ‘std::basic_istream<char>’} and ‘char*’)
   14 |         cin>>(c+1);
      |         ~~~^~~~~~~
      |         |      |
      |         |      char*
      |         std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/13/sstream:40,
                 from /usr/include/c++/13/complex:45,
                 from /usr/include/c++/13/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:127,
                 from answer.code:1:
/usr/include/c++/13/istream:325:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  325 |       operator>>(void*& __p)
      |       ^~~~~~~~
/usr/include/c++/13/istream:325:7: note:   conversion of argument 1 would be ill-formed:
answer.code:14:16: error: cannot bind non-const lvalue reference of type ‘void*&’ to an rvalue of type ‘void*’
   14 |         cin>>(c+1);
      |              ~~^~~
/usr/include/c++/13/istream:201:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  201 |       operator>>(unsigned long long& __n)
      |       ^~~~~~~~
/usr/include/c++/13/istream:201:7: note:   conversion of argument 1 would be ill-formed:
answer.code:14:16: error: invalid conversion from ‘char*’ to ‘long long unsigned int’ [-fpermissive]
   14 |         cin>>(c+1);
      |              ~~^~~
      |                |
      |                char*
answer.code:14:16: error: cannot bind rvalue ‘(long long unsigned int)(((char*)(& c)) + 1)’ to ‘long long unsigned int&’
/usr/include/c++/13/istream:197:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  197 |       operator>>(long long& __n)
      |       ^~~~~~~~
/usr/include/c++/13/istream:197:7: note:   conversion of argument 1 would be ill-formed:
answer.code:14:16: error: invalid conversion from ‘char*’ to ‘long long int’ [-fpermissive]
   14 |         cin>>(c+1);
      |              ~~^~~
      |                |
      |                char*
answer.code:14:16: error: cannot bind rvalue ‘(long long int)(((char*)(& c)) + 1)’ to ‘long long int&’
/usr/include/c++/13/istream:192:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  192 |       operator>>(unsigned long& __n)
      |       ^~~~~~~~
/usr/include/c++/13/istream:192:7: note:   conversion of argument 1 would be ill-formed:
answer.code:14:16: error: invalid conversion from ‘char*’ to ‘long unsigned int’ [-fpermissive]
   14 |         cin>>(c+1);
      |              ~~^~~
      |                |
      |                char*
answer.code:14:16: error: cannot bind rvalue ‘(long unsigned int)(((char*)(& c)) + 1)’ to ‘long unsigned int&’
/usr/include/c++/13/istream:188:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  188 |       operator>>(long& __n)
      |       ^~~~~~~~
/usr/include/c++/13/istream:188:7: note:   conversion of argument 1 would be ill-formed:
answer.code:14:16: error: invalid conversion from ‘char*’ to ‘long int’ [-fpermissive]
   14 |         cin>>(c+1);
      |              ~~^~~
      |                |
      |                char*
answer.code:14:16: error: cannot bind rvalue ‘(long int)(((char*)(& c)) + 1)’ to ‘long int&’
/usr/include/c++/13/istream:184:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  184 |       operator>>(unsigned int& __n)
      |       ^~~~~~~~
/usr/include/c++/13/istream:184:7: note:   conversion of argument 1 would be ill-formed:
answer.code:14:16: error: invalid conversion from ‘char*’ to ‘unsigned int’ [-fpermissive]
   14 |         cin>>(c+1);
      |              ~~^~~
      |                |
      |                char*
answer.code:14:16: error: cannot bind rvalue ‘(unsigned int)(((char*)(& c)) + 1)’ to ‘unsigned int&’
/usr/include/c++/13/istream:181:7: note: candidate: ‘std::...