#197
Combinari
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 | #48841189 | Utilizator | |
Fișier | combinari.cpp | Dimensiune | 728 B |
Data încărcării | 07 Februarie 2024, 10:16 | Scor / rezultat | Eroare de compilare |
combinari.cpp: In function 'void succesor(int, int*, int&)': combinari.cpp:7:12: error: 'n' was not declared in this scope if (st[k]<n) ^ combinari.cpp: In function 'int solutie(int)': combinari.cpp:25:9: error: 'k1' was not declared in this scope if (k==k1) return 1; ^ combinari.cpp: In function 'void tipar()': combinari.cpp:31:14: error: 'k' was not declared in this scope for(i=1; i<=k; i++) ^ combinari.cpp:32:2: error: 'fout' was not declared in this scope fout<<st[i]<<" "; ^ combinari.cpp:32:8: error: 'st' was not declared in this scope fout<<st[i]<<" "; ^ combinari.cpp:33:2: error: 'fout' was not declared in this scope fout<<endl; ^ combinari.cpp:33:8: error: 'endl' was not declared in this scope fout<<endl; ^ combinari.cpp: In function 'int main()': combinari.cpp:36:3: error: 'fin' was not declared in this scope { fin>>n>>k1; ^ combinari.cpp:36:8: error: 'n' was not declared in this scope { fin>>n>>k1; ^ combinari.cpp:36:11: error: 'k1' was not declared in this scope { fin>>n>>k1; ^ combinari.cpp:37:2: error: 'k' was not declared in this scope k=1; ^ combinari.cpp:38:9: error: 'st' was not declared in this scope init(k,st); ^ combinari.cpp:43:16: error: 'as' was not declared in this scope succesor(k,st,as); ^ combinari.cpp:44:22: error: 'ev' was not declared in this scope if (as) valid(k,st, ev); ^ combinari.cpp:46:11: error: 'as' was not declared in this scope while ( (as==1) && (!((ev==1) && ^ combinari.cpp:46:25: error: 'ev' was not declared in this scope while ( (as==1) && (!((ev==1) && ^ combinari.cpp: In function 'int solutie(int)': combinari.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.