#534
Factorial1
Să se scrie un program care citește numărul natural n
și determină valoarea lui n!=1*2*3*...*n
, pentru n ≤ 1000
.
Problema | Factorial1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53484044 | Utilizator | |
Fișier | factorial1.cpp | Dimensiune | 5.78 KB |
Data încărcării | 02 Noiembrie 2024, 11:22 | Scor / rezultat | 100 puncte |
factorial1.cpp: In member function 'BigUint& BigUint::add(const BigUint&)': factorial1.cpp:95:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(nr.size() <= i) nr.push_back(0); ^ factorial1.cpp:96:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(i<oth.size()) nr[i] += oth[i] + r; ^ factorial1.cpp: In member function 'BigUint& BigUint::substract(const BigUint&)': factorial1.cpp:115:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(nr.size() <= i) nr.push_back(0); ^ factorial1.cpp:116:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(i<oth.size()) nr[i] -= oth[i] + r; ^ factorial1.cpp: In member function 'BigUint BigUint::smallMultiply(const llong128&)': factorial1.cpp:134:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(nr.size() <= i) nr.push_back(0); ^ factorial1.cpp: In function 'BigUint multiply(const BigUint&, const BigUint&)': factorial1.cpp:149:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<a.size(); ++i) ^ factorial1.cpp:150:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=0; j<b.size(); ++j) ^ factorial1.cpp:152:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=1; i<c.size(); ++i) ^ factorial1.cpp: In member function 'void BigUint::fromString(std::string)': factorial1.cpp:5:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] #define BIG_BASE_EXP 8 ^ factorial1.cpp:166:33: note: in expansion of macro 'BIG_BASE_EXP' for(int i=0; i<s.size()/BIG_BASE_EXP; ++i) ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | OK. | 20 | 20 | Exemplu | |
2 | 0 secunde | OK. | 20 | 20 | ||
3 | 0 secunde | OK. | 20 | 20 | ||
4 | 0.004 secunde | OK. | 20 | 20 | ||
5 | 0 secunde | OK. | 20 | 20 | ||
Punctaj total | 100 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Factorial1 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ă.