#3630
Se dă n un număr natural. Să se calculeze suma \( \sum_{k=1}^{n}\left ( k!\cdot \left ( k^{2}+k+1 \right ) \right ) \).
| Problema | codred | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64641665 | Utilizator | |
| Fișier | codred.cpp | Dimensiune | 4.75 KB |
| Data încărcării | 20 Mai 2026, 08:24 | Scor/rezultat | 50 puncte |
codred.cpp: In function ‘long long unsigned int putere(int, int)’: codred.cpp:91:12: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 91 | while (b > produs) { | ~~^~~~~~~~ codred.cpp:97:16: warning: comparison of integer expressions of different signedness: ‘long long unsigned int’ and ‘int’ [-Wsign-compare] 97 | if (produs <= b) { | ~~~~~~~^~~~ codred.cpp: In function ‘int PB_ceva()’: codred.cpp:120:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 120 | for (int i = 0; i < strlen(n); i++) { | ~~^~~~~~~~~~~ codred.cpp:121:13: warning: array subscript has type ‘char’ [-Wchar-subscripts] 121 | freq[n[i]]++; | ~~~^ codred.cpp:124:14: warning: array subscript has type ‘char’ [-Wchar-subscripts] 124 | if (freq[i] > 1) { | ^ codred.cpp:125:37: warning: array subscript has type ‘char’ [-Wchar-subscripts] 125 | suma /= Permutari_cu_mod(freq[i]); | ^ codred.cpp:117:7: warning: unused variable ‘k’ [-Wunused-variable] 117 | int k; | ^ codred.cpp: In function ‘int descompunere_factori_factoriale()’: codred.cpp:137:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 137 | for (int i = max(b, c) + 1; i <= a; i++) { | ~~^~~~ codred.cpp:148:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const long long unsigned int’ [-Wsign-compare] 148 | for (int i = 2; i <= min(b, c); i++) { | ~~^~~~~~~~~~~~ codred.cpp:161:1: warning: no return statement in function returning non-void [-Wreturn-type] 161 | } | ^ codred.cpp: In function ‘int ma2in()’: codred.cpp:168:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 168 | for (int i = max(b, c) + 1; i <= a; i++) { | ~~^~~~ codred.cpp:175:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const long long unsigned int’ [-Wsign-compare] 175 | for (int i = 2; i <= min(b, c); i++) { | ~~^~~~~~~~~~~~ codred.cpp:165:27: warning: unused variable ‘cntc’ [-Wunused-variable] 165 | int cnta = 0, cntb = 0, cntc = 0; | ^~~~ codred.cpp:188:1: warning: no return statement in function returning non-void [-Wreturn-type] 188 | } | ^ codred.cpp: In function ‘int main()’: codred.cpp:230:27: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘long long unsigned int’ [-Wsign-compare] 230 | for (long long i = 1; i <= n; i++) { | ~~^~~~ codred.cpp: In function ‘int pb_1297()’: codred.cpp:254:1: warning: no return statement in function returning non-void [-Wreturn-type] 254 | } | ^ codred.cpp: In function ‘int prob4812()’: codred.cpp:225:1: warning: control reaches end of non-void function [-Wreturn-type] 225 | } | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | OK. | 10 | 10 | Exemplu | |
| 2 | 0.002 secunde | OK. | 10 | 10 | ||
| 3 | 0.002 secunde | OK. | 10 | 10 | ||
| 4 | 0.002 secunde | OK. | 10 | 10 | ||
| 5 | 0.001 secunde | OK. | 10 | 10 | ||
| 6 | 0.008 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0.011 secunde | Raspuns gresit. | 10 | 0 | ||
| 8 | 0.03 secunde | Raspuns gresit. | 10 | 0 | ||
| 9 | 0.037 secunde | Raspuns gresit. | 10 | 0 | ||
| 10 | 0.037 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 50 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema codred 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ă.