Borderou de evaluare (job #3207894)

Utilizator smunteanuMunteanu Stefan Catalin smunteanu Data 27 februarie 2024 02:15:01
Problema Bacterii2 Status done
Runda Arhiva ICPC Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In function 'void _(auto:55&, int)': main.cpp:3:179: error: no match for 'operator/' (operand types are 'std::complex<double>' and 'int') 3 | using namespace std;int N=1<<16,t,n,i,o,r;void _(auto&a,int q=0){auto b=a;y(r=n=a.size();r/=2;swap(a,b))y(i=0;i<n/2;i+=r)y(o=0;o<r;++o){auto u=a[i*2+o],v=pow(M_E,(q?-i:i)*M_PI*2i/n)*a[i*2+o+r];b[i+o]=u+v;b[i+n/2+o]=u-v;}if(q)y(auto&x:a)x/=n;}main(){fstream g("bacterii2.in");ofstream l("bacterii2.out");y(g>>t;t--;){vector p(N,0i),q=p;y(g>>n;n--;p[r]+=1)g>>r;y(g>>o;o--;q[r]+=1)g>>r;_(p);_(q);y(i=N;i--;p[i]*=q[i]);_(p,1);y(i=0;i<N;i++){if(o=real(p[i])+.5)l<<i<<" "<<o<<'\n';}l<<'\n';}} | ~~~~~~~~~~~~~~~~^~ | | | | | int | std::complex<double> In file included from /usr/include/c++/12.2.1/ccomplex:39, from /usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/stdc++.h:54, from main.cpp:1: /usr/include/c++/12.2.1/complex:422:5: note: candidate: 'template<class _Tp> constexpr std::complex<_Tp> std::operator/(const complex<_Tp>&, const complex<_Tp>&)' 422 | operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/12.2.1/complex:422:5: note: template argument deduction/substitution failed: main.cpp:3:180: note: mismatched types 'const std::complex<_Tp>' and 'int' 3 | using namespace std;int N=1<<16,t,n,i,o,r;void _(auto&a,int q=0){auto b=a;y(r=n=a.size();r/=2;swap(a,b))y(i=0;i<n/2;i+=r)y(o=0;o<r;++o){auto u=a[i*2+o],v=pow(M_E,(q?-i:i)*M_PI*2i/n)*a[i*2+o+r];b[i+o]=u+v;b[i+n/2+o]=u-v;}if(q)y(auto&x:a)x/=n;}main(){fstream g("bacterii2.in");ofstream l("bacterii2.out");y(g>>t;t--;){vector p(N,0i),q=p;y(g>>n;n--;p[r]+=1)g>>r;y(g>>o;o--;q[r]+=1)g>>r;_(p);_(q);y(i=N;i--;p[i]*=q[i]);_(p,1);y(i=0;i<N;i++){if(o=real(p[i])+.5)l<<i<<" "<<o<<'\n';}l<<'\n';}} | ^ /usr/include/c++/12.2.1/complex:431:5: note: candidate: 'template<class _Tp> constexpr std::complex<_Tp> std::operator/(const complex<_Tp>&, const _Tp&)' 431 | operator/(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/12.2.1/complex:431:5: note: template argument deduction/substitution failed: main.cpp:3:180: note: deduced conflicting types for parameter 'const _Tp' ('double' and 'int') 3 | using namespace std;int N=1<<16,t,n,i,o,r;void _(auto&a,int q=0){auto b=a;y(r=n=a.size();r/=2;swap(a,b))y(i=0;i<n/2;i+=r)y(o=0;o<r;++o){auto u=a[i*2+o],v=pow(M_E,(q?-i:i)*M_PI*2i/n)*a[i*2+o+r];b[i+o]=u+v;b[i+n/2+o]=u-v;}if(q)y(auto&x:a)x/=n;}main(){fstream g("bacterii2.in");ofstream l("bacterii2.out");y(g>>t;t--;){vector p(N,0i),q=p;y(g>>n;n--;p[r]+=1)g>>r;y(g>>o;o--;q[r]+=1)g>>r;_(p);_(q);y(i=N;i--;p[i]*=q[i]);_(p,1);y(i=0;i<N;i++){if(o=real(p[i])+.5)l<<i<<" "<<o<<'\n';}l<<'\n';}} | ^ /usr/include/c++/12.2.1/complex:440:5: note: candidate: 'template<class _Tp> constexpr std::complex<_Tp> std::operator/(const _Tp&, const complex<_Tp>&)' 440 | operator/(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/12.2.1/complex:440:5: note: template argument deduction/substitution failed: main.cpp:3:180: note: mismatched types 'const std::complex<_Tp>' and 'int' 3 | using namespace std;int N=1<<16,t,n,i,o,r;void _(auto&a,int q=0){auto b=a;y(r=n=a.size();r/=2;swap(a,b))y(i=0;i<n/2;i+=r)y(o=0;o<r;++o){auto u=a[i*2+o],v=pow(M_E,(q?-i:i)*M_PI*2i/n)*a[i*2+o+r];b[i+o]=u+v;b[i+n/2+o]=u-v;}if(q)y(auto&x:a)x/=n;}main(){fstream g("bacterii2.in");ofstream l("bacterii2.out");y(g>>t;t--;){vector p(N,0i),q=p;y(g>>n;n--;p[r]+=1)g>>r;y(g>>o;o--;q[r]+=1)g>>r;_(p);_(q);y(i=N;i--;p[i]*=q[i]);_(p,1);y(i=0;i<N;i++){if(o=real(p[i])+.5)l<<i<<" "<<o<<'\n';}l<<'\n';}} | ^ In file included from /usr/include/c++/12.2.1/valarray:603, from /usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/stdc++.h:95: /usr/include/c++/12.2.1/bits/valarray_after.h:408:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__divides, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__divides, typename _Dom1::value_type>::result_type> std::operator/(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 408 | _DEFINE_EXPR_BINARY_OPERATOR(/, struct std::__divides) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/12.2.1/bits/valarray_after.h:408:5: note: template argument deduction/substitution failed: main.cpp:3:180: note: 'std::complex<double>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 3 | using namespace std;int N=1<<16,t,n,i,o,r;void _(auto&a,int q=0){auto b=a;y(r=n=a.size();r/=2;swap(a,b))y(i=0;i<n/2;i+=r)y(o=0;o<r;++o){auto u=a[i*2+o],v=pow(M_E,(q?-i:i)*M_PI*2i/n)*a[i*2+o+r];b[i+o]=u+v;b[i+n/2+o]=u-v;}if(q)y(auto&x:a)x/=n;}main(){fstream g("bacterii2.in");ofstream l("bacterii2.out");y(g>>t;t--;){vector p(N,0i),q=p;y(g>>n;n--;p[r]+=1)g>>r;y(g>>o;o--;q[r]+=1)g>>r;_(p);_(q);y(i=N;i--;p[i]*=q[i]);_(p,1);y(i=0;i<N;i++){if(o=real(p[i])+.5)l<<i<<" "<<o<<'\n';}l<<'\n';}} | ^ /usr/include/c++/12.2.1/bits/valarray_after.h:408:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__divides, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__divides, typename _Dom1::value_type>::result_type> std::operator/(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 408 | _DEFINE_EXPR_BINARY_OPERATOR(/, struct std::__divides) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/12.2.1/bits/valarray_after.h:408:5: note: template argument deduction/substitution failed: main.cpp:3:180: note: 'std::complex<double>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 3 | using namespace std;int N=1<<16,t,n,i,o,r;void _(auto&a,int q=0){auto b=a;y(r=n=a.size();r/=2;swap(a,b))y(i=0;i<n/2;i+=r)y(o=0;o<r;++o){auto u=a[i*2+o],v=pow(M_E,(q?-i:i)*M_PI*2i/n)*a[i*2+o+r];b[i+o]=u+v;b[i+n/2+o]=u-v;}if(q)y(auto&x:a)x/=n;}main(){fstream g("bacterii2.in");ofstream l("bacterii2.out");y(g>>t;t--;){vector p(N,0i),q=p;y(g>>n;n--;p[r]+=1)g>>r;y(g>>o;o--;q[r]+=1)g>>r;_(p);_(q);y(i=N;i--;p[i]*=q[i]);_(p,1);y(i=0;i<N;i++){if(o=real(p[i])+.5)l<<i<<" "<<o<<'\n';}l<<'\n';}} | ^ /usr/include/c++/12.2.1/bits/valarray_after.h:408:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__divides, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__divides, typename _Dom1::value_type>::result_type> std::operator/(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 408 | _DEFINE_EXPR_BINARY_OPERATOR(/, struct std::__divides) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Non zero exit status: 1

Ceva nu functioneaza?