#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 | #38413289 | Utilizator | |
Fișier | prodmax1.cpp | Dimensiune | 942 B |
Data încărcării | 10 Octombrie 2022, 09:48 | Scor / rezultat | Eroare de compilare |
prodmax1.cpp: In function 'int main()': prodmax1.cpp:47:19: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=] scanf("%d", &n); ^ prodmax1.cpp:51:26: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=] scanf("%d", &v[i]); ^ prodmax1.cpp:53:24: error: cannot convert 'long long int*' to 'int*' for argument '3' to 'void quicksort(int, int, int*)' quicksort(0, n-1, v); ^ prodmax1.cpp:55:55: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=] if(v[0]*v[1]>v[n-1]*v[n-2]) printf("%d", v[0]*v[1]); ^ prodmax1.cpp:56:59: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=] else printf("%d", v[n-1]*v[n-2]); ^ prodmax1.cpp:47:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ prodmax1.cpp:51:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &v[i]); ^
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ă.