Borderou de evaluare (job #1945674)
Utilizator | Data | 29 martie 2017 17:08:24 | |
---|---|---|---|
Problema | Mosia | Status | done |
Runda | Arhiva de probleme | Compilator | cpp | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
user.cpp: In function ‘int main()’:
user.cpp:3:534: warning: left operand of comma operator has no effect [-Wunused-value]
struct bred { long long x,y,d; }; long long n,i,x,y,d; bred t[1005]; double gx,gy; double D[1005],D1[1005]; bool cmp(bred x, bred y) { return atan2(y.x-gx,y.y-gy)<atan2(x.x-gx,x.y-gy); } double dist(bred x, bred y) { return sqrt((x.x-y.x)*(x.x-y.x)+(x.y-y.y)*(x.y-y.y)); } int main() { ifstream cin("mosia.in"); ofstream cout("mosia.out"); cin>>n; for (i=1; i<=n; i++) { cin>>x>>y>>d; t[i].x=x; t[i].y=y; t[i].d=d; gx+=x; gy+=y; } gx/=2; gy/=2; sort(t+1,t+n+1,cmp); t[n+1]=t[1]; t[0]=t[n]; for (i=1; i<=n; i++) D1[i]=D[i]=dist((t[i-1],t[i+1])*t[i].d)/2; D[1] = D[n]= 0; for (i=1; i<=n; i++){ D[i]=max(D[i-1],D[i-2]+D[i]); D1[i]=max(D1[i-1],D1[i-2]+D1[i]); } cout<<setprecision(4)<<fixed<<max(D[n],D1[n]); }
^
user.cpp:3:543: error: no match for ‘operator*’ (operand types are ‘bred’ and ‘long long int’)
struct bred { long long x,y,d; }; long long n,i,x,y,d; bred t[1005]; double gx,gy; double D[1005],D1[1005]; bool cmp(bred x, bred y) { return atan2(y.x-gx,y.y-gy)<atan2(x.x-gx,x.y-gy); } double dist(bred x, bred y) { return sqrt((x.x-y.x)*(x.x-y.x)+(x.y-y.y)*(x.y-y.y)); } int main() { ifstream cin("mosia.in"); ofstream cout("mosia.out"); cin>>n; for (i=1; i<=n; i++) { cin>>x>>y>>d; t[i].x=x; t[i].y=y; t[i].d=d; gx+=x; gy+=y; } gx/=2; gy/=2; sort(t+1,t+n+1,cmp); t[n+1]=t[1]; t[0]=t[n]; for (i=1; i<=n; i++) D1[i]=D[i]=dist((t[i-1],t[i+1])*t[i].d)/2; D[1] = D[n]= 0; for (i=1; i<=n; i++){ D[i]=max(D[i-1],D[i-2]+D[i]); D1[i]=max(D1[i-1],D1[i-2]+D1[i]); } cout<<setprecision(4)<<fixed<<max(D[n],D1[n]); }
^
user.cpp:3:543: note: candidates are:
In file included from /usr/include/c++/4.8/ccomplex:38:0,
from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
from user.cpp:1:
/usr/include/c++/4.8/complex:384:5: note: template<class _Tp> std::complex<_Tp> std::operator*(const std::complex<_Tp>&, const std::complex<_Tp>&)
operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
^
/usr/include/c++/4.8/complex:384:5: note: template argument deduction/substitution failed:
user.cpp:3:549: note: ‘bred’ is not derived from ‘const std::complex<_Tp>’
struct bred { long long x,y,d; }; long long n,i,x,y,d; bred t[1005]; double gx,gy; double D[1005],D1[1005]; bool cmp(bred x, bred y) { return atan2(y.x-gx,y.y-gy)<atan2(x.x-gx,x.y-gy); } double dist(bred x, bred y) { return sqrt((x.x-y.x)*(x.x-y.x)+(x.y-y.y)*(x.y-y.y)); } int main() { ifstream cin("mosia.in"); ofstream cout("mosia.out"); cin>>n; for (i=1; i<=n; i++) { cin>>x>>y>>d; t[i].x=x; t[i].y=y; t[i].d=d; gx+=x; gy+=y; } gx/=2; gy/=2; sort(t+1,t+n+1,cmp); t[n+1]=t[1]; t[0]=t[n]; for (i=1; i<=n; i++) D1[i]=D[i]=dist((t[i-1],t[i+1])*t[i].d)/2; D[1] = D[n]= 0; for (i=1; i<=n; i++){ D[i]=max(D[i-1],D[i-2]+D[i]); D1[i]=max(D1[i-1],D1[i-2]+D1[i]); } cout<<setprecision(4)<<fixed<<max(D[n],D1[n]); }
^
In file included from /usr/include/c++/4.8/ccomplex:38:0,
from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
from user.cpp:1:
/usr/include/c++/4.8/complex:393:5: note: template<class _Tp> std::complex<_Tp> std::operator*(const std::complex<_Tp>&, const _Tp&)
operator*(const complex<_Tp>& __x, const _Tp& __y)
^
/usr/include/c++/4.8/complex:393:5: note: template argument deduction/substitution failed:
user.cpp:3:549: note: ‘bred’ is not derived from ‘const std::complex<_Tp>’
struct bred { long long x,y,d; }; long long n,i,x,y,d; bred t[1005]; double gx,gy; double D[1005],D1[1005]; bool cmp(bred x, bred y) { return atan2(y.x-gx,y.y-gy)<atan2(x.x-gx,x.y-gy); } double dist(bred x, bred y) { return sqrt((x.x-y.x)*(x.x-y.x)+(x.y-y.y)*(x.y-y.y)); } int main() { ifstream cin("mosia.in"); ofstream cout("mosia.out"); cin>>n; for (i=1; i<=n; i++) { cin>>x>>y>>d; t[i].x=x; t[i].y=y; t[i].d=d; gx+=x; gy+=y; } gx/=2; gy/=2; sort(t+1,t+n+1,cmp); t[n+1]=t[1]; t[0]=t[n]; for (i=1; i<=n; i++) D1[i]=D[i]=dist((t[i-1],t[i+1])*t[i].d)/2; D[1] = D[n]= 0; for (i=1; i<=n; i++){ D[i]=max(D[i-1],D[i-2]+D[i]); D1[i]=max(D1[i-1],D1[i-2]+D1[i]); } cout<<setprecision(4)<<fixed<<max(D[n],D1[n]); }
^
In file included from /usr/include/c++/4.8/ccomplex:38:0,
from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
from user.cpp:1:
/usr/include/c++/4.8/complex:402:5: note: template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const std::complex<_Tp>&)
operator*(const _Tp& __x, const complex<_Tp>& __y)
^
/usr/include/c++/4.8/complex:402:5: note: template argument deduction/substitution failed:
user.cpp:3:549: note: mismatched types ‘const std::complex<_Tp>’ and ‘long long int’
struct bred { long long x,y,d; }; long long n,i,x,y,d; bred t[1005]; double gx,gy; double D[1005],D1[1005]; bool cmp(bred x, bred y) { return atan2(y.x-gx,y.y-gy)<atan2(x.x-gx,x.y-gy); } double dist(bred x, bred y) { return sqrt((x.x-y.x)*(x.x-y.x)+(x.y-y.y)*(x.y-y.y)); } int main() { ifstream cin("mosia.in"); ofstream cout("mosia.out"); cin>>n; for (i=1; i<=n; i++) { cin>>x>>y>>d; t[i].x=x; t[i].y=y; t[i].d=d; gx+=x; gy+=y; } gx/=2; gy/=2; sort(t+1,t+n+1,cmp); t[n+1]=t[1]; t[0]=t[n]; for (i=1; i<=n; i++) D1[i]=D[i]=dist((t[i-1],t[i+1])*t[i].d)/2; D[1] = D[n]= 0; for (i=1; i<=n; i++){ D[i]=max(D[i-1],D[i-2]+D[i]); D1[i]=max(D1[i-1],D1[i-2]+D1[i]); } cout<<setprecision(4)<<fixed<<max(D[n],D1[n]); }
^
In file included from /usr/include/c++/4.8/valarray:587:0,
from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
from user.cpp:1:
/usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&)
_DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies)
^
/usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template argument deduction/substitution failed:
user.cpp:3:549: note: ‘bred’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’
struct bred { long long x,y,d; }; long long n,i,x,y,d; bred t[1005]; double gx,gy; double D[1005],D1[1005]; bool cmp(bred x, bred y) { return atan2(y.x-gx,y.y-gy)<atan2(x.x-gx,x.y-gy); } double dist(bred x, bred y) { return sqrt((x.x-y.x)*(x.x-y.x)+(x.y-y.y)*(x.y-y.y)); } int main() { ifstream cin("mosia.in"); ofstream cout("mosia.out"); cin>>n; for (i=1; i<=n; i++) { cin>>x>>y>>d; t[i].x=x; t[i].y=y; t[i].d=d; gx+=x; gy+=y; } gx/=2; gy/=2; sort(t+1,t+n+1,cmp); t[n+1]=t[1]; t[0]=t[n]; for (i=1; i<=n; i++) D1[i]=D[i]=dist((t[i-1],t[i+1])*t[i].d)/2; D[1] = D[n]= 0; for (i=1; i<=n; i++){ D[i]=max(D[i-1],D[i-2]+D[i]); D1[i]=max(D1[i-1],D1[i-2]+D1[i]); } cout<<setprecision(4)<<fixed<<max(D[n],D1[n]); }
^
In file included from /usr/include/c++/4.8/valarray:587:0,
from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !