#1010
produs
Se dau două șiruri cu câte n
, respectiv m
elemente. Dacă înmulțim fiecare element din primul șir cu fiecare element din al doilea șir, să se afle câte produse sunt mai mici decât p
.
Problema | produs | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 4 MB
/
Stivă 1 MB
|
Id soluție | #58255036 | Utilizator | |
Fișier | produs.cpp | Dimensiune | 1.26 KB |
Data încărcării | 22 Mai 2025, 15:25 | Scor / rezultat | Eroare de compilare |
produs.cpp:46:13: error: redefinition of 'std::ifstream fin' ifstream fin("frecventa1.in"); ^ produs.cpp:6:10: error: 'std::ifstream fin' previously declared here ifstream fin("frecventa1.in"); ^ produs.cpp:47:14: error: redefinition of 'std::ofstream fout' ofstream fout("frecventa1.out"); ^ produs.cpp:7:10: error: 'std::ofstream fout' previously declared here ofstream fout("frecventa1.out"); ^ produs.cpp:49:12: error: redefinition of 'int a [10001]' int a[10001],b[10001]; ^ produs.cpp:9:5: error: 'int a [10001]' previously declared here int a[10001],b[10001]; ^ produs.cpp:49:21: error: redefinition of 'int b [10001]' int a[10001],b[10001]; ^ produs.cpp:9:14: error: 'int b [10001]' previously declared here int a[10001],b[10001]; ^ produs.cpp:50:9: error: redefinition of 'int i' int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:10:9: error: 'int i' previously declared here int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:50:11: error: redefinition of 'int x' int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:10:11: error: 'int x' previously declared here int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:50:13: error: redefinition of 'int n' int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:10:13: error: 'int n' previously declared here int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:50:15: error: redefinition of 'int maxb' int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:10:15: error: 'int maxb' previously defined here int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:50:22: error: redefinition of 'int maxa' int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:10:22: error: 'int maxa' previously defined here int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:50:29: error: redefinition of 'int j' int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:10:29: error: 'int j' previously declared here int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:50:31: error: redefinition of 'int ok' int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:10:31: error: 'int ok' previously defined here int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:50:36: error: redefinition of 'int p' int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:10:36: error: 'int p' previously declared here int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:50:38: error: redefinition of 'int m' int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:10:38: error: 'int m' previously declared here int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:50:40: error: redefinition of 'int ct' int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp:10:40: error: 'int ct' previously defined here int i,x,n,maxb=0,maxa=0,j,ok=0,p,m,ct=0; ^ produs.cpp: In function 'int main()': produs.cpp:52:5: error: redefinition of 'int main()' int main() ^ produs.cpp:12:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema produs 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ă.