#165
maxsim
Să se determine perechea de elemente dintr-un vector egal depărtate de centru cu suma elementelor maximă.
Problema | maxsim | Operații I/O |
maxsim.in /maxsim.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54744374 | Utilizator | |
Fișier | maxsim.cpp | Dimensiune | 476 B |
Data încărcării | 07 Decembrie 2024, 10:09 | Scor / rezultat | Eroare de compilare |
maxsim.cpp: In function 'int main()': maxsim.cpp:10:7: error: expected '(' before 'v' { if v[i]+v[j]>v[i_max]+v[j_max] ^ maxsim.cpp: In lambda function: maxsim.cpp:14:31: error: expected '{' before '<<' token fout<<v[i_max]<<" "<<[j_max]<<" "; ^ maxsim.cpp: In function 'int main()': maxsim.cpp:14:17: error: cannot bind 'std::basic_ostream<char>' lvalue to 'std::basic_ostream<char>&&' fout<<v[i_max]<<" "<<[j_max]<<" "; ^ In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/fstream:38, from maxsim.cpp:1: /usr/include/c++/4.8/ostream:602:5: error: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = main()::__lambda0]' operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x) ^ maxsim.cpp:15:28: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-' fout<<" "<<i_max<<" "<<j-max; ^ maxsim.cpp: In lambda function: maxsim.cpp:17:33: error: expected '{' before '<<' token { fout<<v[i_max]<<" "<<[j_max]<<" "; ^ maxsim.cpp: In function 'int main()': maxsim.cpp:17:19: error: cannot bind 'std::basic_ostream<char>' lvalue to 'std::basic_ostream<char>&&' { fout<<v[i_max]<<" "<<[j_max]<<" "; ^ In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/fstream:38, from maxsim.cpp:1: /usr/include/c++/4.8/ostream:602:5: error: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = main()::__lambda1]' operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x) ^ maxsim.cpp:18:28: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-' fout<<" "<<i_max<<" "<<j-max; ^ maxsim.cpp:6:20: warning: unused variable 's' [-Wunused-variable] { int n, i=1, j=n, s, v[1001]={0}, i_max=0, j_max=0; ^ maxsim.cpp:21:2: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema maxsim face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.