#3330
Se dau numerele naturale n și k. Calculați \( C_n^k \).
| Problema | CalculCombinari | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64641341 | Utilizator | |
| Fișier | calculcombinari.cpp | Dimensiune | 4.04 KB |
| Data încărcării | 20 Mai 2026, 01:29 | Scor/rezultat | 40 puncte |
calculcombinari.cpp: In function ‘long long unsigned int putere(int, int)’: calculcombinari.cpp:79:12: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 79 | while (b > produs) { | ~~^~~~~~~~ calculcombinari.cpp:85:16: warning: comparison of integer expressions of different signedness: ‘long long unsigned int’ and ‘int’ [-Wsign-compare] 85 | if (produs <= b) { | ~~~~~~~^~~~ calculcombinari.cpp: In function ‘int PB_ceva()’: calculcombinari.cpp:108:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 108 | for (int i = 0; i < strlen(n); i++) { | ~~^~~~~~~~~~~ calculcombinari.cpp:109:13: warning: array subscript has type ‘char’ [-Wchar-subscripts] 109 | freq[n[i]]++; | ~~~^ calculcombinari.cpp:112:14: warning: array subscript has type ‘char’ [-Wchar-subscripts] 112 | if (freq[i] > 1) { | ^ calculcombinari.cpp:113:37: warning: array subscript has type ‘char’ [-Wchar-subscripts] 113 | suma /= Permutari_cu_mod(freq[i]); | ^ calculcombinari.cpp:105:7: warning: unused variable ‘k’ [-Wunused-variable] 105 | int k; | ^ calculcombinari.cpp: In function ‘int descompunere_factori_factoriale()’: calculcombinari.cpp:125:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 125 | for (int i = max(b, c) + 1; i <= a; i++) { | ~~^~~~ calculcombinari.cpp:136:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const long long unsigned int’ [-Wsign-compare] 136 | for (int i = 2; i <= min(b, c); i++) { | ~~^~~~~~~~~~~~ calculcombinari.cpp:149:1: warning: no return statement in function returning non-void [-Wreturn-type] 149 | } | ^ calculcombinari.cpp: In function ‘int ma2in()’: calculcombinari.cpp:156:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 156 | for (int i = max(b, c) + 1; i <= a; i++) { | ~~^~~~ calculcombinari.cpp:163:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const long long unsigned int’ [-Wsign-compare] 163 | for (int i = 2; i <= min(b, c); i++) { | ~~^~~~~~~~~~~~ calculcombinari.cpp:153:27: warning: unused variable ‘cntc’ [-Wunused-variable] 153 | int cnta = 0, cntb = 0, cntc = 0; | ^~~~ calculcombinari.cpp:176:1: warning: no return statement in function returning non-void [-Wreturn-type] 176 | } | ^ calculcombinari.cpp: In function ‘int prob4812()’: calculcombinari.cpp:213:1: warning: control reaches end of non-void function [-Wreturn-type] 213 | } | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | OK. | 5 | 5 | Exemplu | |
| 2 | 0.001 secunde | OK. | 5 | 5 | ||
| 3 | 0.001 secunde | OK. | 5 | 5 | ||
| 4 | 0.001 secunde | OK. | 5 | 5 | ||
| 5 | 0.001 secunde | OK. | 10 | 10 | ||
| 6 | 0.002 secunde | OK. | 10 | 10 | ||
| 7 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 8 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 9 | 0.002 secunde | Caught fatal signal 8 | 5 | 0 | ||
| 10 | 0.001 secunde | Caught fatal signal 8 | 10 | 0 | ||
| 11 | 0.001 secunde | Caught fatal signal 8 | 10 | 0 | ||
| 12 | 0.001 secunde | Caught fatal signal 8 | 10 | 0 | ||
| 13 | 0.001 secunde | Caught fatal signal 8 | 10 | 0 | ||
| Punctaj total | 40 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CalculCombinari 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ă.