#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 |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56948480 | Utilizator | |
Fișier | prodmax1.cpp | Dimensiune | 551 B |
Data încărcării | 11 Martie 2025, 14:35 | Scor / rezultat | Eroare de compilare |
prodmax1.cpp:2:17: error: 'str' is not a namespace-name using namespace str; ^ prodmax1.cpp:2:20: error: expected namespace-name before ';' token using namespace str; ^ prodmax1.cpp: In function 'int main()': prodmax1.cpp:5:18: error: 'INT_MAX' was not declared in this scope int n,x,min1=INT_MAX,min2=INT_MAX; ^ prodmax1.cpp:6:14: error: 'INT_MIN' was not declared in this scope int max1=INT_MIN,max2=INT_MIL; ^ 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:8:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ prodmax1.cpp:13:13: error: 'min2' was not declared in this scope min2=min1; ^ prodmax1.cpp:15:13: error: expected '}' before 'else' else if (x<min2) ^ prodmax1.cpp:15:24: error: 'min2' was not declared in this scope else if (x<min2) ^ prodmax1.cpp:17:22: error: 'max2' was not declared in this scope if(x>max2) ^ prodmax1.cpp:22:21: error: 'max2' was not declared in this scope if(max1*max2>min1*min2) ^ prodmax1.cpp:22:31: error: 'min2' was not declared in this scope if(max1*max2>min1*min2) ^ prodmax1.cpp:23:17: error: 'cout' was not declared in this scope cout<<max1*max2; ^ prodmax1.cpp:23: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:24:18: error: 'cout' was not declared in this scope else cout<<min1*min2; ^ prodmax1.cpp:24:18: 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:25:9: 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ă.