#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 | #50583670 | Utilizator | |
Fișier | prodmax.cpp | Dimensiune | 542 B |
Data încărcării | 16 Aprilie 2024, 08:36 | Scor / rezultat | Eroare de compilare |
prodmax.cpp:5:27: error: redefinition of 'int j' int a[101][101],i,j,k0,k1,j,max; ^ prodmax.cpp:5:19: error: 'int j' previously declared here int a[101][101],i,j,k0,k1,j,max; ^ prodmax.cpp: In function 'int main()': prodmax.cpp:7:10: error: 'n' was not declared in this scope cin>>n>>m; ^ prodmax.cpp:7:13: error: 'm' was not declared in this scope cin>>n>>m; ^ prodmax.cpp:12:6: error: 'k2' was not declared in this scope {k2=k0=0; ^ prodmax.cpp:16:19: error: 'v' was not declared in this scope if(k0!=0)v[i]=0; ^ prodmax.cpp:17:15: error: 'v' was not declared in this scope else v[j]=k2; ^ prodmax.cpp:18:13: error: 'maxi2' was not declared in this scope if(maxi2<v[j])maxi2=v[j]; ^ prodmax.cpp:18:19: error: 'v' was not declared in this scope if(maxi2<v[j])maxi2=v[j]; ^ prodmax.cpp:21:12: error: 'v' was not declared in this scope if(v[j]==max2)cout<<' '; ^ prodmax.cpp:21:18: error: 'max2' was not declared in this scope if(v[j]==max2)cout<<' '; ^
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ă.