#3953
Se dă un număr natural n. Determinaţi, în ordine lexicografică, toate modalităţile de a-l scrie pe n ca sumă de termeni strict crescători din șirul lui Fibonacci.
| Problema | descfib | Operații I/O |
descfib.in/descfib.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #47762864 | Utilizator | |
| Fișier | descfib.cpp | Dimensiune | 731 B |
| Data încărcării | 02 Ianuarie 2024, 13:54 | Scor/rezultat | Eroare de compilare |
descfib.cpp:10:13: error: conflicting declaration 'int f [26]' int f[FMAX+1], x[FMAX+1], n; ^ descfib.cpp:5:10: error: 'f' has a previous declaration as 'std::ifstream f' ifstream f ("descfib.in"); ^ descfib.cpp: In function 'void fibo()': descfib.cpp:13:6: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[1] = f[2] = 1; ^ descfib.cpp:13:13: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[1] = f[2] = 1; ^ descfib.cpp:15:10: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[i] = f[i-1] + f[i-2]; ^ descfib.cpp:15:17: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[i] = f[i-1] + f[i-2]; ^ descfib.cpp:15:26: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[i] = f[i-1] + f[i-2]; ^ descfib.cpp: In function 'void afis(int)': descfib.cpp:20:15: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') g << f[x[i]] << ' '; ^ descfib.cpp: In function 'void backTracking(int, int)': descfib.cpp:26:31: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') for (int i=x[k-1]+1; f[i] <= n-s; i++) { ^ descfib.cpp:28:34: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') backTracking(k+1, s+f[i]); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema descfib 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ă.