#2409
Numim număr mare un număr care conține prea multe cifre pentru a fi memorat în tipurile existente, și număr mic un număr care poate fi memorat în acestea.
Se dau două numere, unul mare și unul mic, ambele pozitive. Calculați produsul lor.
| Problema | ProdusXL | Operații I/O |
produsxl.in/produsxl.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64799012 | Utilizator | |
| Fișier | produsxl.cpp | Dimensiune | 2.25 KB |
| Data încărcării | 02 Iunie 2026, 09:39 | Scor/rezultat | 80 puncte |
produsxl.cpp: In function ‘HugeInt& operator+=(HugeInt&, const HugeInt&)’: produsxl.cpp:24:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 24 | for (i = 0; i < lhs.cifre.size(); ++i) { | ~~^~~~~~~~~~~~~~~~~~ produsxl.cpp:26:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 26 | if (i < rhs.cifre.size()) remorca += rhs.cifre[i]; | ~~^~~~~~~~~~~~~~~~~~ produsxl.cpp:30:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 30 | while (i < rhs.cifre.size()) { | ~~^~~~~~~~~~~~~~~~~~ produsxl.cpp: In function ‘HugeInt operator*(const HugeInt&, const HugeInt&)’: produsxl.cpp:51:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 51 | for (int i = 0; i < lhs.cifre.size(); ++i) { | ~~^~~~~~~~~~~~~~~~~~ produsxl.cpp:52:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 52 | for (int j = 0; j < rhs.cifre.size(); ++j) { | ~~^~~~~~~~~~~~~~~~~~ produsxl.cpp:56:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 56 | for (int i = 0; i < rez.cifre.size(); ++i) { | ~~^~~~~~~~~~~~~~~~~~ produsxl.cpp: In function ‘int main()’: produsxl.cpp:76:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 76 | freopen("produsxl.in", "r", stdin); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ produsxl.cpp:77:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 77 | freopen("produsxl.out", "w", stdout); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 20 | 20 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 5 | 0.001 secunde | OK. | 20 | 20 | ||
| Punctaj total | 80 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ProdusXL 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ă.