#2271
ProdMax1
Se dă un șir cu n
numere întregi. Determinați cel mai mare număr care poate fi scris ca produs de două elemente ale șirului.
Problema | ProdMax1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53719024 | Utilizator | |
Fișier | prodmax1.cpp | Dimensiune | 654 B |
Data încărcării | 09 Noiembrie 2024, 16:00 | Scor / rezultat | Eroare de compilare |
prodmax1.cpp: In function 'int poz(int, int)': prodmax1.cpp:8:45: error: 'swap' was not declared in this scope if(a[st]<a[dr]) swap(a[st],a[dr]); ^ prodmax1.cpp:8:45: note: suggested alternatives: In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from prodmax1.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:2717:5: note: 'std::swap' swap(basic_string<_CharT, _Traits, _Alloc>& __lhs, ^ In file included from /usr/include/c++/4.8/exception:152:0, from /usr/include/c++/4.8/ios:39, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from prodmax1.cpp:1: /usr/include/c++/4.8/bits/exception_ptr.h:160:5: note: 'std::__exception_ptr::swap' swap(exception_ptr& __lhs, exception_ptr& __rhs) ^ prodmax1.cpp: In function 'int main()': prodmax1.cpp:25:5: error: 'cin' was not declared in this scope cin>>n; ^ prodmax1.cpp:25:5: note: suggested alternative: In file included from prodmax1.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ prodmax1.cpp:30:17: error: 'cout' was not declared in this scope if(mx1>mx2) cout<<mx1; ^ prodmax1.cpp:30:17: note: suggested alternative: In file included from prodmax1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ prodmax1.cpp:31:10: error: 'cout' was not declared in this scope else cout<<mx2; ^ prodmax1.cpp:31:10: note: suggested alternative: In file included from prodmax1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ProdMax1 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ă.