#3689
Se n și m numere naturale. Afișați în ordine lexicografică toate șirurile de lungime m care conțin numere de la 1 la n și fiecare valoare apare de maxim două ori.
| Problema | 2gen | Operații I/O |
2gen.in/2gen.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64212581 | Utilizator | |
| Fișier | gen.cpp | Dimensiune | 574 B |
| Data încărcării | 23 Aprilie 2026, 10:27 | Scor/rezultat | Eroare de compilare |
gen.cpp:5:16: warning: missing terminating " character 5 | ofstream fout ("2genc.out'); | ^ gen.cpp:5:16: error: missing terminating " character 5 | ofstream fout ("2genc.out'); | ^~~~~~~~~~~~~ gen.cpp:6:24: error: expected ‘)’ before ‘{’ token 6 | void backtrack(int pas) { | ^~ | ) gen.cpp:5:15: note: to match this ‘(’ 5 | ofstream fout ("2genc.out'); | ^ gen.cpp: In function ‘std::ofstream fout(void (*)(int))’: gen.cpp:7:9: error: ‘pas’ was not declared in this scope 7 | if (pas>m) { | ^~~ gen.cpp:9:17: error: invalid operands of types ‘std::ofstream(void (*)(int))’ {aka ‘std::basic_ofstream<char>(void (*)(int))’} and ‘int’ to binary ‘operator<<’ 9 | fout<<x[i]<<" "; | ~~~~^~~~~~ | | | | | int | std::ofstream(void (*)(int)) {aka std::basic_ofstream<char>(void (*)(int))} gen.cpp:10:13: error: invalid operands of types ‘std::ofstream(void (*)(int))’ {aka ‘std::basic_ofstream<char>(void (*)(int))’} and ‘const char [2]’ to binary ‘operator<<’ 10 | fout<<"\n"; | ~~~~^~~~~~ | | | | | const char [2] | std::ofstream(void (*)(int)) {aka std::basic_ofstream<char>(void (*)(int))} gen.cpp:16:24: error: expected ‘;’ before ‘}’ token 16 | start=1 | ^ | ; 17 | } | ~ gen.cpp:23:1: warning: no return statement in function returning non-void [-Wreturn-type] 23 | } | ^ gen.cpp: In function ‘int main()’: gen.cpp:26:5: error: ‘backtrack’ was not declared in this scope 26 | backtrack(1); | ^~~~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema 2gen 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ă.