#2271
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 | #57367808 | Utilizator | |
Fișier | prodmax1.cpp | Dimensiune | 1.17 KB |
Data încărcării | 27 Martie 2025, 17:20 | Scor / rezultat | 80 puncte |
prodmax1.cpp: In function 'int main()': prodmax1.cpp:35:27: warning: format '%lld' expects argument of type 'long long int*', but argument 2 has type 'int*' [-Wformat=] scanf("%lld",&a[i]); ^ prodmax1.cpp:38:32: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int' [-Wformat=] printf("%lld",a[1]*a[2]); ^ prodmax1.cpp:40:34: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int' [-Wformat=] printf("%lld",a[n]*a[n-1]); ^ prodmax1.cpp:45:30: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int' [-Wformat=] printf("%lld",x*y); ^ prodmax1.cpp:47:30: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int' [-Wformat=] printf("%lld",x*z); ^ prodmax1.cpp:49:30: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int' [-Wformat=] printf("%lld",y*z); ^ prodmax1.cpp:32:21: warning: unused variable 's' [-Wunused-variable] long long int n,s=0; ^ prodmax1.cpp:33:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%lld",&n); ^ prodmax1.cpp:35:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%lld",&a[i]); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | OK. | 20 | 20 | Exemplu | |
2 | 0 secunde | OK. | 20 | 20 | ||
3 | 0 secunde | OK. | 10 | 10 | ||
4 | 0.02 secunde | OK. | 10 | 10 | ||
5 | 0 secunde | OK. | 10 | 10 | ||
6 | 0.02 secunde | OK. | 10 | 10 | ||
7 | 0.02 secunde | Raspuns gresit. | 10 | 0 | ||
8 | 0.02 secunde | Raspuns gresit. | 10 | 0 | ||
Punctaj total | 80 |
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ă.