#2793
Considerăm următorul șir, în care n este un număr natural nenul: \( f_n = \begin{cases}
0& \text{dacă } n = 1,\\
3& \text{dacă } n = 2,\\
2 \cdot f_{n-1} – f_{n-2} + 2& \text{dacă } n > 2.
\end{cases} \)
Primii termeni ai acestui șir sunt: 0, 3, 8, 15, 24, 35, 48, 63, 80 ....
Se citesc două numere naturale din intervalul [0,109], x și y, reprezentând valorile a doi termeni aflați pe poziții consecutive în șirul dat (x<y), și se cere să se afișeze, în ordine strict descrescătoare, separați prin câte un spațiu, toţi termenii șirului mai mici sau egali cu y.
Subiect Bacalaureat 2018, sesiune august-septembrie
| Problema | PozitiiConsecutive | Operații I/O |
pozitiiconsecutive.in/pozitiiconsecutive.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64669867 | Utilizator | |
| Fișier | pozitiiconsecutive.cpp | Dimensiune | 5.53 KB |
| Data încărcării | 21 Mai 2026, 14:58 | Scor/rezultat | Eroare de compilare |
pozitiiconsecutive.cpp:16:24: error: exponent has no digits 16 | font-size: 2.2em; | ^~~~~ pozitiiconsecutive.cpp:22:20: error: stray ‘#’ in program 22 | color: #aaa; | ^ pozitiiconsecutive.cpp:40:49: error: stray ‘#’ in program 40 | background: linear-gradient(135deg, #0a0a0a 0%, #1a3a5c 50%, #0a0a0a 100%); | ^ pozitiiconsecutive.cpp:40:61: error: stray ‘#’ in program 40 | background: linear-gradient(135deg, #0a0a0a 0%, #1a3a5c 50%, #0a0a0a 100%); | ^ pozitiiconsecutive.cpp:40:74: error: stray ‘#’ in program 40 | background: linear-gradient(135deg, #0a0a0a 0%, #1a3a5c 50%, #0a0a0a 100%); | ^ pozitiiconsecutive.cpp:41:31: error: stray ‘#’ in program 41 | border: 2px solid #2d6fa8; | ^ pozitiiconsecutive.cpp:50:22: error: empty character constant 50 | content: ''; | ^~ pozitiiconsecutive.cpp:63:49: error: stray ‘#’ in program 63 | background: linear-gradient(135deg, #0d1a2e 0%, #2a5f9e 50%, #0d1a2e 100%); | ^ pozitiiconsecutive.cpp:63:61: error: stray ‘#’ in program 63 | background: linear-gradient(135deg, #0d1a2e 0%, #2a5f9e 50%, #0d1a2e 100%); | ^ pozitiiconsecutive.cpp:63:74: error: stray ‘#’ in program 63 | background: linear-gradient(135deg, #0d1a2e 0%, #2a5f9e 50%, #0d1a2e 100%); | ^ pozitiiconsecutive.cpp:65:20: error: stray ‘#’ in program 65 | color: #cfe8ff; | ^ pozitiiconsecutive.cpp:66:27: error: stray ‘#’ in program 66 | border-color: #4a9fd4; | ^ pozitiiconsecutive.cpp:76:24: error: exponent has no digits 76 | font-size: 1.1em; | ^~~~~ pozitiiconsecutive.cpp:77:20: error: stray ‘#’ in program 77 | color: #4a9fd4; | ^ pozitiiconsecutive.cpp:91:31: error: stray ‘#’ in program 91 | background-color: #1a3a5c; | ^ pozitiiconsecutive.cpp:92:20: error: stray ‘#’ in program 92 | color: #cfe8ff; | ^ pozitiiconsecutive.cpp:97:31: error: stray ‘#’ in program 97 | border: 1px solid #2d6fa8; | ^ pozitiiconsecutive.cpp:102:31: error: stray ‘#’ in program 102 | border: 1px solid #222; | ^ pozitiiconsecutive.cpp:106:31: error: stray ‘#’ in program 106 | background-color: #0d0d0d; | ^ pozitiiconsecutive.cpp:111:31: error: stray ‘#’ in program 111 | border: 1px solid #222; | ^ pozitiiconsecutive.cpp:113:20: error: stray ‘#’ in program 113 | color: #ccc; | ^ pozitiiconsecutive.cpp:118:31: error: stray ‘#’ in program 118 | background-color: #0d1f35; | ^ pozitiiconsecutive.cpp:123:20: error: stray ‘#’ in program 123 | color: #7ec8f0; | ^ pozitiiconsecutive.cpp:123:21: error: exponent has no digits 123 | color: #7ec8f0; | ^~~~~~ pozitiiconsecutive.cpp:125:27: error: stray ‘#’ in program 125 | border-color: #2d6fa8; | ^ pozitiiconsecutive.cpp:131:35: error: too many decimal points in number 131 | <p>Acest site a fost făcut pe 07.05.2026</p> | ^~~~~~~~~~ pozitiiconsecutive.cpp:135:9: error: extended character ▶ is not valid in an identifier 135 | ▶ Click aici pentru Metallica Youtube | ^ pozitiiconsecutive.cpp:1:1: error: expected unqualified-id before ‘<’ token 1 | <!DOCTYPE html> | ^ pozitiiconsecutive.cpp:15:9: error: ‘h1’ does not name a type 15 | h1 { | ^~ pozitiiconsecutive.cpp:21:9: error: ‘p’ does not name a type 21 | p { | ^ pozitiiconsecutive.cpp:26:9: error: ‘img’ does not name a type 26 | img { | ^~~ pozitiiconsecutive.cpp:31:9: error: expected unqualified-id before ‘.’ token 31 | .btn-metallica { | ^ pozitiiconsecutive.cpp:49:9: error: expected unqualified-id before ‘.’ token 49 | .btn-metallica::before { | ^ pozitiiconsecutive.cpp:58:9: error: expected unqualified-id before ‘.’ token 58 | .btn-metallica:hover::before { | ^ pozitiiconsecutive.cpp:62:9: error: expected unqualified-id before ‘.’ token 62 | .btn-metallica:hover { | ^ pozitiiconsecutive.cpp:70:9: error: expected unqualified-id before ‘.’ token 70 | .tabel-container { | ^ pozitiiconsecutive.cpp:75:9: error: expected unqualified-id before ‘.’ token 75 | .tabel-container h2 { | ^ pozitiiconsecutive.cpp:83:9: error: ‘table’ does not name a type; did you mean ‘mutable’? 83 | table { | ^~~~~ | mutable pozitiiconsecutive.cpp:90:9: error: ‘thead’ does not name a type 90 | thead tr { | ^~~~~ pozitiiconsecutive.cpp:95:9: error: ‘thead’ does not name a type 95 | thead th { | ^~~~~ pozitiiconsecutive.cpp:101:9: error: ‘tbody’ does not name a type 101 | tbody tr { | ^~~~~ pozitiiconsecutive.cpp:105:9: error: ‘tbody’ does not name a type 105 | tbody tr:nth-child(even) { | ^~~~~ pozitiiconsecutive.cpp:109:9: error: ‘tbody’ does not name a type 109 | tbody td { | ^~~~~ pozitiiconsecutive.cpp:117:9: error: ‘tbody’ does not name a type 117 | tbody tr.miercuri { | ^~~~~ pozitiiconsecutive.cpp:122:9: error: ‘tbody’ does not name a type 122 | tbody tr.miercuri td { | ^~~~~ pozitiiconsecutive.cpp:127:5: error: expected unqualified-id before ‘<’ token 127 | </style> | ^ pozitiiconsecutive.cpp:154:9: error: ‘var’ does not name a type 154 | var cheie = "accesari_zile"; | ^~~ pozitiiconsecutive.cpp:157:9: error: ‘var’ does not name a type 157 | var date = localStorage.getItem(cheie); | ^~~ pozitiiconsecutive.cpp:158:9: error: expected unqualified-id before ‘if’ 158 | if (date) { | ^~ pozitiiconsecutive.cpp:160:11: error: expected unqualified-id before ‘else’ 160 | } else { | ^~~~ pozitiiconsecutive.cpp:165:9: error: ‘var’ does not name a type 165 | var indexAzi = new Date().getDay(); // 0 = duminica, 3 = miercuri | ^~~ pozitiiconsecutive.cpp:166:9: error: ‘var’ does not name a type 166 | var numeZiAzi = ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"][indexAzi]; | ^~~ pozitiiconsecutive.cpp:169:9: error: ‘date’ does not name a type 169 | date[numeZiAzi] = (date[numeZiAzi] || 0) + 1; | ^~~~ pozitiiconsecutive.cpp:172:9: error: ‘localStorage’ does not name a type 172 | localStorage.setItem(cheie, JSON.stringify(date)); | ^~~~~~~~~~~~ pozitiiconsecutive.cpp:175:9: error: ‘var’ does not name a type 175 | var tbody = document.getElementById("tabel-body"); | ^~~ pozitiiconsecutive.cpp:176:9: error: expected unqualified-id before ‘for’ 176 | for (var i = 0; i < zile.length; i++) { | ^~~ pozitiiconsecutive.cpp:176:25: error: ‘i’ does not name a type 176 | for (var i = 0; i < zile.length; i++) { | ^ pozitiiconsecutive.cpp:176:42: error: ‘i’ does not name a type 176 | for (var i = 0; i < zile.length; i++) { | ^ pozitiiconsecutive.cpp:192:5: error: expected unqualified-id before ‘<’ token 192 | </script> | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PozitiiConsecutive 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ă.