#1991
Trepte2
O persoana are de urcat n
trepte. Ştiind că de pe treapta i
poate trece pe treapta i + 1, i + 2, ..., i + (k - 1)
sau i + k
, aflaţi în câte moduri poate urca cele n
trepte. (inițial este pe treapta 1
)
Problema | Trepte2 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #15646582 | Utilizator | |
Fișier | trepte2.cpp | Dimensiune | 731 B |
Data încărcării | 05 Mai 2019, 13:41 | Scor / rezultat | Eroare de compilare |
trepte2.cpp:4:1: error: stray '\302' in program int solutie(int x){ ^ trepte2.cpp:4:1: error: stray '\240' in program trepte2.cpp:5:1: error: stray '\302' in program return (v[x] == n); ^ trepte2.cpp:5:1: error: stray '\240' in program trepte2.cpp:8:1: error: stray '\302' in program { ^ trepte2.cpp:8:1: error: stray '\240' in program trepte2.cpp:8:1: error: stray '\302' in program trepte2.cpp:8:1: error: stray '\240' in program trepte2.cpp:9:1: error: stray '\302' in program if (x > 1) ^ trepte2.cpp:9:1: error: stray '\240' in program trepte2.cpp:11:1: error: stray '\302' in program for (int i = 1; i < x; i++) ^ trepte2.cpp:11:1: error: stray '\240' in program trepte2.cpp:12:1: error: stray '\302' in program if (v[x] == v[i]) return 0; ^ trepte2.cpp:12:1: error: stray '\240' in program trepte2.cpp:12:1: error: stray '\302' in program trepte2.cpp:12:1: error: stray '\240' in program trepte2.cpp:12:1: error: stray '\302' in program trepte2.cpp:12:1: error: stray '\240' in program trepte2.cpp:12:1: error: stray '\302' in program trepte2.cpp:12:1: error: stray '\240' in program trepte2.cpp:12:1: error: stray '\302' in program trepte2.cpp:12:1: error: stray '\240' in program trepte2.cpp:12:1: error: stray '\302' in program trepte2.cpp:12:1: error: stray '\240' in program trepte2.cpp:12:1: error: stray '\302' in program trepte2.cpp:12:1: error: stray '\240' in program trepte2.cpp:12:1: error: stray '\302' in program trepte2.cpp:12:1: error: stray '\240' in program trepte2.cpp:13:2: error: stray '\302' in program if (v[x - 1] > v[x]) return 0; ^ trepte2.cpp:13:2: error: stray '\240' in program trepte2.cpp:13:2: error: stray '\302' in program trepte2.cpp:13:2: error: stray '\240' in program trepte2.cpp:13:2: error: stray '\302' in program trepte2.cpp:13:2: error: stray '\240' in program trepte2.cpp:13:2: error: stray '\302' in program trepte2.cpp:13:2: error: stray '\240' in program trepte2.cpp:13:2: error: stray '\302' in program trepte2.cpp:13:2: error: stray '\240' in program trepte2.cpp:13:2: error: stray '\302' in program trepte2.cpp:13:2: error: stray '\240' in program trepte2.cpp:14:1: error: stray '\302' in program if (v[x] - v[x- 1] > k) return 0; ^ trepte2.cpp:14:1: error: stray '\240' in program trepte2.cpp:14:1: error: stray '\302' in program trepte2.cpp:14:1: error: stray '\240' in program trepte2.cpp:14:1: error: stray '\302' in program trepte2.cpp:14:1: error: stray '\240' in program trepte2.cpp:14:1: error: stray '\302' in program trepte2.cpp:14:1: error: stray '\240' in program trepte2.cpp:14:1: error: stray '\302' in program trepte2.cpp:14:1: error: stray '\240' in program trepte2.cpp:15:1: error: stray '\302' in program } ^ trepte2.cpp:15:1: error: stray '\240' in program trepte2.cpp:15:1: error: stray '\302' in program trepte2.cpp:15:1: error: stray '\240' in program trepte2.cpp:19:2: error: stray '\302' in program for (int i = 1; i <= n; i++) ^ trepte2.cpp:19:2: error: stray '\240' in program trepte2.cpp:19:2: error: stray '\302' in program trepte2.cpp:19:2: error: stray '\240' in program trepte2.cpp:19:2: error: stray '\302' in program trepte2.cpp:19:2: error: stray '\240' in program trepte2.cpp:19:2: error: stray '\302' in program trepte2.cpp:19:2: error: stray '\240' in program trepte2.cpp:19:2: error: stray '\302' in program trepte2.cpp:19:2: error: stray '\240' in program trepte2.cpp:20:3: error: stray '\302' in program { v[x] = i; ^ trepte2.cpp:20:3: error: stray '\240' in program trepte2.cpp:20:3: error: stray '\302' in program trepte2.cpp:20:3: error: stray '\240' in program trepte2.cpp:20:3: error: stray '\302' in program trepte2.cpp:20:3: error: stray '\240' in program trepte2.cpp:20:3: error: stray '\302' in program trepte2.cpp:20:3: error: stray '\240' in program trepte2.cpp:20:3: error: stray '\302' in program trepte2.cpp:20:3: error: stray '\240' in program trepte2.cpp:20:3: error: stray '\302' in program trepte2.cpp:20:3: error: stray '\240' in program trepte2.cpp:20:3: error: stray '\302' in program trepte2.cpp:20:3: error: stray '\240' in program trepte2.cpp:21:3: error: stray '\302' in program if (valid(x)) ^ trepte2.cpp:21:3: error: stray '\240' in program trepte2.cpp:21:3: error: stray '\302' in program trepte2.cpp:21:3: error: stray '\240' in program trepte2.cpp:21:3: error: stray '\302' in program trepte2.cpp:21:3: error: stray '\240' in program trepte2.cpp:21:3: error: stray '\302' in program trepte2.cpp:21:3: error: stray '\240' in program trepte2.cpp:21:3: error: stray '\302' in program trepte2.cpp:21:3: error: stray '\240' in program trepte2.cpp:22:3: error: stray '\302' in program if (solutie(x)) ^ trepte2.cpp:22:3: error: stray '\240' in program trepte2.cpp:22:3: error: stray '\302' in program trepte2.cpp:22:3: error: stray '\240' in program trepte2.cpp:22:3: error: stray '\302' in program trepte2.cpp:22:3: error: stray '\240' in program trepte2.cpp:22:3: error: stray '\302' in program trepte2.cpp:22:3: error: stray '\240' in program trepte2.cpp:22:3: error: stray '\302' in program trepte2.cpp:22:3: error: stray '\240' in program trepte2.cpp:23:4: error: stray '\302' in program nr++; ^ trepte2.cpp:23:4: error: stray '\240' in program trepte2.cpp:23:4: error: stray '\302' in program trepte2.cpp:23:4: error: stray '\240' in program trepte2.cpp:23:4: error: stray '\302' in program trepte2.cpp:23:4: error: stray '\240' in program trepte2.cpp:23:4: error: stray '\302' in program trepte2.cpp:23:4: error: stray '\240' in program trepte2.cpp:23:4: error: stray '\302' in program trepte2.cpp:23:4: error: stray '\240' in program trepte2.cpp:23:4: error: stray '\302' in program trepte2.cpp:23:4: error: stray '\240' in program trepte2.cpp:23:4: error: stray '\302' in program trepte2.cpp:23:4: error: stray '\240' in program trepte2.cpp:23:4: error: stray '\302' in program trepte2.cpp:23:4: error: stray '\240' in program trepte2.cpp:23:4: error: stray '\302' in program trepte2.cpp:23:4: error: stray '\240' in program trepte2.cpp:24:4: error: stray '\302' in program else ^ trepte2.cpp:24:4: error: stray '\240' in program trepte2.cpp:24:4: error: stray '\302' in program trepte2.cpp:24:4: error: stray '\240' in program trepte2.cpp:25:5: error: stray '\302' in program Back(x + 1); ^ trepte2.cpp:25:5: error: stray '\240' in program trepte2.cpp:26:6: error: stray '\302' in program } ^ trepte2.cpp:26:6: error: stray '\240' in program trepte2.cpp:29:1: error: stray '\302' in program { ^ trepte2.cpp:29:1: error: stray '\240' in program trepte2.cpp:29:1: error: stray '\302' in program trepte2.cpp:29:1: error: stray '\240' in program trepte2.cpp:33:3: error: stray '\302' in program cout << nr; ^ trepte2.cpp:33:3: error: stray '\240' in program trepte2.cpp:33:3: error: stray '\302' in program trepte2.cpp:33:3: error: stray '\240' in program trepte2.cpp:33:3: error: stray '\302' in program trepte2.cpp:33:3: error: stray '\240' in program trepte2.cpp:34:3: error: stray '\302' in program return 0; ^ trepte2.cpp:34:3: error: stray '\240' in program trepte2.cpp: In function 'void Back(int)': trepte2.cpp:21:9: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if (valid(x)) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Trepte2 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ă.