QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#487376#6234. 动物园hhwCompile Error//C++23651b2024-07-22 20:49:492024-07-22 20:49:49

Judging History

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

  • [2024-07-22 20:49:49]
  • 评测
  • [2024-07-22 20:49:49]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const long long mod=1e9+7; 
string b; long long n,i,j,ans=1;char a[1223123];
long long nex[12112321],num[12312123];
int main()
{
	cin>>n;
	for(long long o=1;o<=n;o++){
		cin>>(a+1);
		long long ll=strlen(a+1);
		ans=1;
		num[1]=1;
		for(i=2,j=0;i<=ll;++i){
			while(j&&a[i]!=a[j+1])j=nex[j];
			if(a[i]==a[j+1])j++;
			nex[i]=j;
			num[i]=num[j]+1;
		}
		for(long long i=2,j=0;i<=ll;i++){
			while(j&&a[i]!=a[j+1])j=nex[j];
			if(a[i]==a[j+1])j++;
			while(j*2>i){
				j=nex[j];
			}
			ans*=(num[j]+1)%1000000007;
			ans%=1000000007;
		}
		cout<<ans<<endl;
	}
	return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:10:20: error: no match for ‘operator>>’ (operand types are ‘std::istream’ {aka ‘std::basic_istream<char>’} and ‘char*’)
   10 |                 cin>>(a+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:10:24: error: cannot bind non-const lvalue reference of type ‘void*&’ to an rvalue of type ‘void*’
   10 |                 cin>>(a+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:10:24: error: invalid conversion from ‘char*’ to ‘long long unsigned int’ [-fpermissive]
   10 |                 cin>>(a+1);
      |                      ~~^~~
      |                        |
      |                        char*
answer.code:10:24: error: cannot bind rvalue ‘(long long unsigned int)(((char*)(& a)) + 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:10:24: error: invalid conversion from ‘char*’ to ‘long long int’ [-fpermissive]
   10 |                 cin>>(a+1);
      |                      ~~^~~
      |                        |
      |                        char*
answer.code:10:24: error: cannot bind rvalue ‘(long long int)(((char*)(& a)) + 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:10:24: error: invalid conversion from ‘char*’ to ‘long unsigned int’ [-fpermissive]
   10 |                 cin>>(a+1);
      |                      ~~^~~
      |                        |
      |                        char*
answer.code:10:24: error: cannot bind rvalue ‘(long unsigned int)(((char*)(& a)) + 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:10:24: error: invalid conversion from ‘char*’ to ‘long int’ [-fpermissive]
   10 |                 cin>>(a+1);
      |                      ~~^~~
      |                        |
      |                        char*
answer.code:10:24: error: cannot bind rvalue ‘(long int)(((char*)(& a)) + 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:10:24: error: invalid conversion from ‘char*’ to ‘unsigned int’ [-fpermissive]
   10 |                 cin>>(a+1);
      |                      ~~^~~
      |       ...