#4010
MosCraciun2
Moș Crăciun pregătește cadourile pentru acest an. El trebuie să dea cadouri identice la n
copii. Pentru aceasta, a vizitat m
magazine (posibil online) și pentru fiecare magazin a aflat prețul cadoului în acel magazin și numărul de cadouri disponibile în acel magazin.
Determinati suma minimă necesară pentru a cumpăra cele n
cadouri. Dacă nu se pot cumpăra cele n
cadouri afișați mesajul imposibil
.
Problema | MosCraciun2 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #40124693 | Utilizator | |
Fișier | moscraciun2.java | Dimensiune | 2.10 KB |
Data încărcării | 27 Noiembrie 2022, 19:53 | Scor / rezultat | Eroare de compilare |
moscraciun2.java:2: error: illegal character: \35 #include <iostream> ^ moscraciun2.java:2: error: class, interface, or enum expected #include <iostream> ^ moscraciun2.java:3: error: illegal character: \35 #include <string> ^ moscraciun2.java:4: error: illegal character: \35 #include <vector> ^ moscraciun2.java:5: error: illegal character: \35 #include <algorithm> ^ moscraciun2.java:9: error: illegal start of type public: ^ moscraciun2.java:9: error: ';' expected public: ^ moscraciun2.java:11: error: > expected template < typename T > static T input() { ^ moscraciun2.java:11: error: <identifier> expected template < typename T > static T input() { ^ moscraciun2.java:11: error: '(' expected template < typename T > static T input() { ^ moscraciun2.java:13: error: illegal start of expression std::cin >> value; ^ moscraciun2.java:13: error: not a statement std::cin >> value; ^ moscraciun2.java:19: error: illegal start of type public: ^ moscraciun2.java:19: error: ';' expected public: ^ moscraciun2.java:20: error: <identifier> expected static void main(std::vector<std::string> &args) ^ moscraciun2.java:20: error: ';' expected static void main(std::vector<std::string> &args) ^ moscraciun2.java:20: error: > expected static void main(std::vector<std::string> &args) ^ moscraciun2.java:20: error: ';' expected static void main(std::vector<std::string> &args) ^ moscraciun2.java:20: error: <identifier> expected static void main(std::vector<std::string> &args) ^ moscraciun2.java:20: error: illegal start of type static void main(std::vector<std::string> &args) ^ moscraciun2.java:20: error: ';' expected static void main(std::vector<std::string> &args) ^ moscraciun2.java:22: error: ')' expected Scanner cin = java.util.Scanner(java.io.BufferedInputStream@61e717c2); ^ moscraciun2.java:22: error: floating point number too large Scanner cin = java.util.Scanner(java.io.BufferedInputStream@61e717c2); ^ moscraciun2.java:22: error: ';' expected Scanner cin = java.util.Scanner(java.io.BufferedInputStream@61e717c2); ^ moscraciun2.java:22: error: ';' expected Scanner cin = java.util.Scanner(java.io.BufferedInputStream@61e717c2); ^ moscraciun2.java:24: error: ';' expected int n = Settlement::input<int>(); ^ moscraciun2.java:24: error: not a statement int n = Settlement::input<int>(); ^ moscraciun2.java:24: error: ';' expected int n = Settlement::input<int>(); ^ moscraciun2.java:25: error: ';' expected int m = Settlement::input<int>(); ^ moscraciun2.java:25: error: not a statement int m = Settlement::input<int>(); ^ moscraciun2.java:25: error: ';' expected int m = Settlement::input<int>(); ^ moscraciun2.java:26: error: illegal start of expression std::vector<moscraciun2::Shop::Shop*> sh(m); ^ moscraciun2.java:26: error: > expected std::vector<moscraciun2::Shop::Shop*> sh(m); ^ moscraciun2.java:26: error: not a statement std::vector<moscraciun2::Shop::Shop*> sh(m); ^ moscraciun2.java:26: error: illegal start of expression std::vector<moscraciun2::Shop::Shop*> sh(m); ^ moscraciun2.java:26: error: ';' expected std::vector<moscraciun2::Shop::Shop*> sh(m); ^ moscraciun2.java:26: error: illegal start of expression std::vector<moscraciun2::Shop::Shop*> sh(m); ^ moscraciun2.java:30: error: '(' or '[' expected sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:30: error: illegal start of expression sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:30: error: ';' expected sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:30: error: ')' expected sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:30: error: illegal start of expression sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:30: error: ';' expected sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:30: error: illegal start of expression sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:30: error: illegal start of expression sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:30: error: ';' expected sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:30: error: illegal start of expression sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:30: error: not a statement sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:30: error: ';' expected sh[i] = new moscraciun2::Shop::Shop(Settlement::input<int>(), Settlement::input<int>()); ^ moscraciun2.java:31: error: illegal start of expression sum += sh[i]->cant; ^ moscraciun2.java:35: error: illegal start of expression std::cout << "imposibil" << std::endl; ^ moscraciun2.java:35: error: not a statement std::cout << "imposibil" << std::endl; ^ moscraciun2.java:35: error: ';' expected std::cout << "imposibil" << std::endl; ^ moscraciun2.java:35: error: not a statement std::cout << "imposibil" << std::endl; ^ moscraciun2.java:42: error: illegal start of expression if (sh[i]->cant <= n) ^ moscraciun2.java:44: error: illegal start of expression result += sh[i]->price * sh[i]->cant; ^ moscraciun2.java:44: error: illegal start of expression result += sh[i]->price * sh[i]->cant; ^ moscraciun2.java:45: error: illegal start of expression n -= sh[i]->cant; ^ moscraciun2.java:47: error: illegal start of expression else if (n <= sh[i]->cant) ^ moscraciun2.java:49: error: illegal start of expression result += sh[i]->price * n; ^ moscraciun2.java:53: error: illegal start of expression std::cout << result << std::endl; ^ moscraciun2.java:53: error: not a statement std::cout << result << std::endl; ^ moscraciun2.java:53: error: ';' expected std::cout << result << std::endl; ^ moscraciun2.java:53: error: not a statement std::cout << result << std::endl; ^ moscraciun2.java:56: error: '{' expected class Shop : public java.lang.Comparable ^ moscraciun2.java:56: error: <identifier> expected class Shop : public java.lang.Comparable ^ moscraciun2.java:58: error: illegal start of type private : ^ moscraciun2.java:58: error: ';' expected private : ^ moscraciun2.java:59: error: illegal start of type moscraciun2 *parentClass; ^ moscraciun2.java:60: error: illegal start of type public: ^ moscraciun2.java:60: error: ';' expected public: ^ moscraciun2.java:61: error: illegal start of type Shop(moscraciun2 *parentClass) { ^ moscraciun2.java:61: error: ';' expected Shop(moscraciun2 *parentClass) { ^ moscraciun2.java:61: error: <identifier> expected Shop(moscraciun2 *parentClass) { ^ moscraciun2.java:62: error: illegal start of expression this->parentClass = parentClass; ^ moscraciun2.java:68: error: illegal start of expression this->price = price; ^ moscraciun2.java:69: error: illegal start of expression this->cant = cant; ^ moscraciun2.java:71: error: <identifier> expected int compareTo(Shop* other) ^ moscraciun2.java:71: error: ';' expected int compareTo(Shop* other) ^ moscraciun2.java:71: error: illegal start of type int compareTo(Shop* other) ^ moscraciun2.java:71: error: <identifier> expected int compareTo(Shop* other) ^ moscraciun2.java:72: error: ';' expected { ^ moscraciun2.java:73: error: illegal start of type return this->price - other->price; ^ moscraciun2.java:73: error: <identifier> expected return this->price - other->price; ^ moscraciun2.java:73: error: ';' expected return this->price - other->price; ^ moscraciun2.java:73: error: <identifier> expected return this->price - other->price; ^ moscraciun2.java:73: error: <identifier> expected return this->price - other->price; ^ moscraciun2.java:73: error: illegal start of type return this->price - other->price; ^ moscraciun2.java:76: error: class, interface, or enum expected }; ^ moscraciun2.java:77: error: class, interface, or enum expected int main(int argc, char **argv){ ^ moscraciun2.java:79: error: class, interface, or enum expected moscraciun2::main(parameter); ^ moscraciun2.java:80: error: class, interface, or enum expected return 0; ^ moscraciun2.java:81: error: class, interface, or enum expected }; ^ 93 errors
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MosCraciun2 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ă.