#197
Se citesc două numere naturale nenule n și k. Să se afişeze, în ordine lexicografică, submulțimile de câte k elemente ale mulţimii {1,2,..,n}.
| Problema | Combinari | Operații I/O |
combinari.in/combinari.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64245981 | Utilizator | |
| Fișier | combinari.cpp | Dimensiune | 955 B |
| Data încărcării | 25 Aprilie 2026, 13:07 | Scor/rezultat | 0 puncte |
combinari.cpp: In function ‘void afis(int)’: combinari.cpp:9:7: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 9 | for(int i=1; i<=k; i++) | ^~~ combinari.cpp:11:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 11 | cout<<endl; | ^~~~ combinari.cpp: In function ‘bool ok(int)’: combinari.cpp:19:6: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 19 | for(int i=1; i<=k-1; i++) | ^~~ combinari.cpp:22:10: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 22 | return 1; | ^~~~~~ combinari.cpp: In function ‘void backtracking(int)’: combinari.cpp:37:15: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 37 | if(ok(k)==1) | ^ combinari.cpp: In function ‘bool ok(int)’: combinari.cpp:17:22: warning: array subscript -1 is below array bounds of ‘int [11]’ [-Warray-bounds=] 17 | if(st[k]<st[k-1]) | ~~~~~~^ combinari.cpp:4:6: note: while referencing ‘st’ 4 | int st[11], n, m; | ^~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 30 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 30 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Combinari 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ă.