#2245
Plata1
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.
Problema | Plata1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #18347648 | Utilizator | |
Fișier | plata1.cpp | Dimensiune | 825 B |
Data încărcării | 04 Noiembrie 2019, 12:37 | Scor / rezultat | Eroare de compilare |
plata1.cpp:3:1: error: 's' does not name a type s ^ plata1.cpp: In function 'void citire()': plata1.cpp:9:9: error: 'n' was not declared in this scope cin>>n>>s; ^ plata1.cpp:9:12: error: 's' was not declared in this scope cin>>n>>s; ^ plata1.cpp:12:10: error: 'v' was not declared in this scope cin>>v[i]; ^ plata1.cpp:14:10: error: 'c' was not declared in this scope cin>>c[i]; ^ plata1.cpp: In function 'void afis()': plata1.cpp:20:8: error: 'sum' was not declared in this scope if(sum[n]==s) ^ plata1.cpp:20:12: error: 'n' was not declared in this scope if(sum[n]==s) ^ plata1.cpp:20:16: error: 's' was not declared in this scope if(sum[n]==s) ^ plata1.cpp:23:15: error: 'st' was not declared in this scope cout<<st[i]<<" "; ^ plata1.cpp: In function 'int solutie(int)': plata1.cpp:31:15: error: 'n' was not declared in this scope return p==n; ^ plata1.cpp: In function 'int valid(int)': plata1.cpp:37:7: error: 's' was not declared in this scope if(s>=sum[p]) ^ plata1.cpp:37:10: error: 'sum' was not declared in this scope if(s>=sum[p]) ^ plata1.cpp: In function 'void bk(int)': plata1.cpp:46:16: error: 'c' was not declared in this scope for(i=0;i<=c[p];i++) ^ plata1.cpp:48:13: error: 'st' was not declared in this scope st[p]=i; ^ plata1.cpp:49:13: error: 'sum' was not declared in this scope sum[p]=sum[p-1]+i*v[p]; ^ plata1.cpp:49:31: error: 'v' was not declared in this scope sum[p]=sum[p-1]+i*v[p]; ^ plata1.cpp:50:15: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(valid(p)) ^ plata1.cpp: In function 'int solutie(int)': plata1.cpp:32:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Plata1 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ă.