#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 | #53224576 | Utilizator | |
Fișier | combinari.cpp | Dimensiune | 709 B |
Data încărcării | 21 Octombrie 2024, 20:25 | Scor / rezultat | Eroare de compilare |
combinari.cpp:3:14: warning: missing terminating " character [enabled by default] ifstream cin("combinari.in); ^ combinari.cpp:3:1: error: missing terminating " character ifstream cin("combinari.in); ^ combinari.cpp:4:15: warning: missing terminating " character [enabled by default] ofstream cout("combinari.out); ^ combinari.cpp:4:1: error: missing terminating " character ofstream cout("combinari.out); ^ combinari.cpp:5:8: error: 'st' has not been declared int k, st[100], n, z; ^ combinari.cpp:5:17: error: 'n' has not been declared int k, st[100], n, z; ^ combinari.cpp:5:20: error: 'z' has not been declared int k, st[100], n, z; ^ combinari.cpp:5:21: error: expected ')' before ';' token int k, st[100], n, z; ^ combinari.cpp:5:21: error: expected ')' before ';' token combinari.cpp: In function 'int valid(int)': combinari.cpp:9:11: error: 'st' was not declared in this scope if (st[i] == st[z]) return 0; ^ combinari.cpp:10:9: error: 'k' was not declared in this scope if (k > 1) ^ combinari.cpp:11:11: error: 'st' was not declared in this scope if (st[z] < st[z - 1]) return 0; ^ combinari.cpp: In function 'void becky(int)': combinari.cpp:16:26: error: 'n' was not declared in this scope for (int i = 1; i <= n; i++) ^ combinari.cpp:18:9: error: 'st' was not declared in this scope st[z] = i; ^ combinari.cpp:21:22: error: 'k' was not declared in this scope if (z == k) ^ combinari.cpp:24:19: error: 'cout' was not declared in this scope cout << st[j] << " "; ^ combinari.cpp:25:17: error: 'cout' was not declared in this scope cout << endl; ^ combinari.cpp: In function 'int main()': combinari.cpp:33:12: error: 'n' was not declared in this scope cin >> n >> k; ^ combinari.cpp:33:17: error: 'k' was not declared in this scope cin >> n >> k; ^
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ă.