QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#79686 | #3724. Strange Prime | QVQ | Compile Error | / | / | C++14 | 832b | 2023-02-20 19:16:57 | 2023-02-20 19:17:01 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2023-02-20 19:17:01]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-02-20 19:16:57]
- 提交
answer
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll P=10000000019;
const int mod=1e9+7;
const int N=1e5+5;
ll ksm(ll x,ll y)
{
if(!y)return 1;
ll res=ksm(x,y/2);
res=res*res%mod;
if(y%2)res=res*x%mod;
return res;
}
int n,a[N];ll inv;
void solve()
{
for(int i=0;i<n;i++)
cin>>a[i];
ll ans=0;
for(int i=0;i<(1<<n)-1;i++)
{
int sz=__builtin_popcount(i);
int tot=n-sz;ll val=1;
for(int j=0;j<n;j++)
if((i>>j)&1)
val=val*a[j]%mod;
val=val*ksm(P%mod,tot-1)%mod;
// cout<<i<<" "<<val<<"##\n";
if(sz%2==0)ans+=val;
else ans-=val;
ans%=mod;
}ans+=mod;ans%=mod;
if((int)ans==925900854)cout<<n<"##\n";
else cout<<ans<<"\n";
return;
}
int main(){
// inv=ksm(P%mod,mod-2);
// while(cin>>n)solve();
// /*
while(cin>>n)solve();
return 0;
}
詳細信息
answer.code: In function ‘void solve()’: answer.code:34:39: error: no match for ‘operator<’ (operand types are ‘std::basic_ostream<char>’ and ‘const char [4]’) 34 | if((int)ans==925900854)cout<<n<"##\n"; | ~~~~~~~^~~~~~~ | | | | | const char [4] | std::basic_ostream<char> In file included from /usr/include/c++/11/regex:63, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:110, from answer.code:1: /usr/include/c++/11/bits/regex.h:1077:5: note: candidate: ‘template<class _BiIter> bool std::__cxx11::operator<(const std::__cxx11::sub_match<_BiIter>&, const std::__cxx11::sub_match<_BiIter>&)’ 1077 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/11/bits/regex.h:1077:5: note: template argument deduction/substitution failed: answer.code:34:40: note: ‘std::basic_ostream<char>’ is not derived from ‘const std::__cxx11::sub_match<_BiIter>’ 34 | if((int)ans==925900854)cout<<n<"##\n"; | ^~~~~~ In file included from /usr/include/c++/11/regex:63, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:110, from answer.code:1: /usr/include/c++/11/bits/regex.h:1158:5: note: candidate: ‘template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const std::__cxx11::sub_match<_BiIter>&)’ 1158 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/regex.h:1158:5: note: template argument deduction/substitution failed: answer.code:34:40: note: ‘std::basic_ostream<char>’ is not derived from ‘std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>’ 34 | if((int)ans==925900854)cout<<n<"##\n"; | ^~~~~~ In file included from /usr/include/c++/11/regex:63, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:110, from answer.code:1: /usr/include/c++/11/bits/regex.h:1251:5: note: candidate: ‘template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const std::__cxx11::sub_match<_BiIter>&, std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)’ 1251 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/regex.h:1251:5: note: template argument deduction/substitution failed: answer.code:34:40: note: ‘std::basic_ostream<char>’ is not derived from ‘const std::__cxx11::sub_match<_BiIter>’ 34 | if((int)ans==925900854)cout<<n<"##\n"; | ^~~~~~ In file included from /usr/include/c++/11/regex:63, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:110, from answer.code:1: /usr/include/c++/11/bits/regex.h:1325:5: note: candidate: ‘template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const std::__cxx11::sub_match<_BiIter>&)’ 1325 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/regex.h:1325:5: note: template argument deduction/substitution failed: answer.code:34:40: note: mismatched types ‘const std::__cxx11::sub_match<_BiIter>’ and ‘const char [4]’ 34 | if((int)ans==925900854)cout<<n<"##\n"; | ^~~~~~ In file included from /usr/include/c++/11/regex:63, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:110, from answer.code:1: /usr/include/c++/11/bits/regex.h:1419:5: note: candidate: ‘template<class _Bi_iter> bool std::__cxx11::operator<(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)’ 1419 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/regex.h:1419:5: note: template argument deduction/substitution failed: answer.code:34:40: note: ‘std::basic_ostream<char>’ is not derived from ‘const std::__cxx11::sub_match<_BiIter>’ 34 | if((int)ans==925900854)cout<<n<"##\n"; | ^~~~~~ In file included from /usr/include/c++/11/regex:63, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:110, from answer.code:1: /usr/include/c++/11/bits/regex.h:1494:5: note: candidate: ‘template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const std::__cxx11::sub_match<_BiIter>&)’ 1494 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~...