#220
ProdMax
Se dă o matrice cu elemente numere naturale, care conţine doar valorile {0,1,2}
. Să se determine numerele de ordine ale coloanelor pentru care produsul elementelor este maxim.
Variante Bacalaureat 2009
Problema | ProdMax | Operații I/O |
prodmax.in /prodmax.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #20037636 | Utilizator | |
Fișier | prodmax.cpp | Dimensiune | 807 B |
Data încărcării | 16 Ianuarie 2020, 14:52 | Scor / rezultat | Eroare de compilare |
prodmax.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream fout("prodmax.in") ^ prodmax.cpp: In function 'int main()': prodmax.cpp:25:10: error: 'm' was not declared in this scope fin>>m>>n; ^ prodmax.cpp:25:13: error: 'n' was not declared in this scope fin>>m>>n; ^ prodmax.cpp:26:9: error: 'i' was not declared in this scope for(i=1;i<=m;i++) ^ prodmax.cpp:27:13: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ prodmax.cpp:28:18: error: 'a' was not declared in this scope fin>>a[i][j]; ^ prodmax.cpp:29:9: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ prodmax.cpp:31:16: error: 'a' was not declared in this scope if(nrz(a,m,n,j)==0) ^ prodmax.cpp:34:9: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ prodmax.cpp:35:12: error: 'a' was not declared in this scope if(a[0][j]>mx) ^ prodmax.cpp:35:20: error: 'mx' was not declared in this scope if(a[0][j]>mx) ^ prodmax.cpp:37:9: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ prodmax.cpp:38:12: error: 'a' was not declared in this scope if(a[0][j]==mx) ^ prodmax.cpp:38:21: error: 'mx' was not declared in this scope if(a[0][j]==mx) ^ prodmax.cpp:39:9: error: 'fout' was not declared in this scope fout<<j<<' '; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ProdMax 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ă.