#3169
Plata2
Se consideră n
tipuri de bancnote, cu valorile v[1] v[2] ... v[n]
, ordonate strict crescător. Pentru fiecare tip de bancnote se știe numărul de bancnote disponibile c[1] c[2] ... c[n]
. Se cere să se determine o modalitate de a plăti integral o sumă dată S
cu bancnotele disponibile, astfel încât să se folosească cel puțin o bancnotă de fiecare tip.
Problema | Plata2 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50377707 | Utilizator | |
Fișier | plata2.cpp | Dimensiune | 875 B |
Data încărcării | 07 Aprilie 2024, 12:25 | Scor / rezultat | Eroare de compilare |
plata2.cpp:4:11: error: 'MAX' was not declared in this scope int n,S,b[MAX],x[MAX],y[MAX]; ^ plata2.cpp:4:18: error: 'MAX' was not declared in this scope int n,S,b[MAX],x[MAX],y[MAX]; ^ plata2.cpp:4:25: error: 'MAX' was not declared in this scope int n,S,b[MAX],x[MAX],y[MAX]; ^ plata2.cpp: In function 'void citire()': plata2.cpp:10:14: error: 'b' was not declared in this scope cin>>b[i]; ^ plata2.cpp:12:14: error: 'y' was not declared in this scope cin>>y[i]; ^ plata2.cpp: In function 'int suma(int)': plata2.cpp:19:12: error: 'x' was not declared in this scope s+=x[i]*b[i]; ^ plata2.cpp:19:17: error: 'b' was not declared in this scope s+=x[i]*b[i]; ^ plata2.cpp: In function 'void scrie()': plata2.cpp:32:12: error: 'x' was not declared in this scope if(x[i]>0) ^ plata2.cpp:37:19: error: 'x' was not declared in this scope cout<<x[i]<<' '; ^ plata2.cpp: In function 'void bk(int)': plata2.cpp:51:24: error: 'y' was not declared in this scope for(int i=0;i<=y[k];++i) ^ plata2.cpp:53:13: error: 'x' was not declared in this scope x[k]=i; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Plata2 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ă.