#2245
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 |
![]() |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53120197 | Utilizator | |
Fișier | plata1.cpp | Dimensiune | 498 B |
Data încărcării | 18 Octombrie 2024, 09:26 | Scor / rezultat | Eroare de compilare |
plata1.cpp: In function 'void afisare(int)': plata1.cpp:7:4: error: 'cout' was not declared in this scope cout<<x[i]<<" "; ^ plata1.cpp:7:4: note: suggested alternative: In file included from plata1.cpp:2:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ plata1.cpp:7:10: error: 'x' was not declared in this scope cout<<x[i]<<" "; ^ plata1.cpp: In function 'void Back(int, int)': plata1.cpp:15:9: error: 'x' was not declared in this scope x[k]=i; ^ plata1.cpp:16:18: error: 'i' was not declared in this scope if(sum+v[i]*c[k]<=s&&k<=n) ^ plata1.cpp:16:27: error: 's' was not declared in this scope if(sum+v[i]*c[k]<=s&&k<=n) ^ plata1.cpp: In function 'int main()': plata1.cpp:28:1: error: 'cin' was not declared in this scope cin>>n>>s; ^ plata1.cpp:28:1: note: suggested alternative: In file included from plata1.cpp:2:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ plata1.cpp:28:9: error: 's' was not declared in this scope cin>>n>>s; ^ plata1.cpp:34:1: error: expected ';' before '}' token } ^
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ă.