#220
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 | #57980627 | Utilizator | |
Fișier | prodmax.cpp | Dimensiune | 610 B |
Data încărcării | 06 Mai 2025, 16:07 | Scor / rezultat | Eroare de compilare |
prodmax.cpp:4:1: error: expected ',' or ';' before 'ofstream' ofstream g("prodmax.out") ^ prodmax.cpp: In function 'int main()': prodmax.cpp:8:8: error: 'n' was not declared in this scope f>>n>>m; ^ prodmax.cpp:8:11: error: 'm' was not declared in this scope f>>n>>m; ^ prodmax.cpp:9:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ prodmax.cpp:10:13: error: 'j' was not declared in this scope for(j=1;j<=m;j++) ^ prodmax.cpp:11:9: error: 'cin' was not declared in this scope cin>>a[i][j]; ^ prodmax.cpp:11:14: error: 'a' was not declared in this scope cin>>a[i][j]; ^ prodmax.cpp:12:9: error: 'j' was not declared in this scope for(j=1;j<=m;j++) ^ prodmax.cpp:14:7: error: 'nr2' was not declared in this scope nr2=0; ^ prodmax.cpp:15:7: error: 'nr0' was not declared in this scope nr0=0; ^ prodmax.cpp:16:11: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ prodmax.cpp:17:12: error: 'a' was not declared in this scope if(a[i][j]==2) ^ prodmax.cpp:21:14: error: 'vmax' was not declared in this scope if(nr2>vmax&&nr0==0) ^ prodmax.cpp:23:7: error: 'v0' was not declared in this scope v0[j]=nr0; ^ prodmax.cpp:25:8: error: 'vmax' was not declared in this scope if(vmax>0) ^ prodmax.cpp:26:13: error: 'j' was not declared in this scope for(j=1;j<=m;j++) ^ prodmax.cpp:27:14: error: 'v2' was not declared in this scope if(v2[j]==vmax&&v0[j]==0) ^ prodmax.cpp:27:27: error: 'v0' was not declared in this scope if(v2[j]==vmax&&v0[j]==0) ^ prodmax.cpp:28:16: error: 'g' was not declared in this scope g<<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ă.