#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 | #44060213 | Utilizator | |
Fișier | prodmax1.cpp | Dimensiune | 559 B |
Data încărcării | 14 Iunie 2023, 18:11 | Scor / rezultat | Eroare de compilare |
prodmax1.cpp: In function 'int main()': prodmax1.cpp:7:5: error: 'cin' was not declared in this scope cin>>n; ^ prodmax1.cpp:7: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:10:10: error: 'i' was not declared in this scope for (i=1;i<=n;i++) ^ prodmax1.cpp:19:20: error: 'sort' was not declared in this scope sort(v+1, v+n+1); ^ prodmax1.cpp:19:20: note: suggested alternative: In file included from /usr/include/c++/4.8/algorithm:62:0, from prodmax1.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h:5483:5: note: 'std::sort' sort(_RandomAccessIterator __first, _RandomAccessIterator __last, ^ prodmax1.cpp:25:5: error: expected ';' before '}' token } ^ prodmax1.cpp:28:5: error: expected ';' before '}' token } ^ prodmax1.cpp:29:5: error: 'cout' was not declared in this scope cout<<max(max1,max2); ^ prodmax1.cpp:29:5: 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:29:24: error: 'max' was not declared in this scope cout<<max(max1,max2); ^ prodmax1.cpp:29:24: note: suggested alternative: In file included from /usr/include/c++/4.8/algorithm:62:0, from prodmax1.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: 'std::max' max(initializer_list<_Tp> __l, _Compare __comp) ^ prodmax1.cpp:31:1: error: expected '}' at end of input } ^
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ă.