#3387
În parcul orașului există trei rânduri de câte n copaci perfect aliniați. Rândurile sunt notate A, B, C, iar copacii de pe fiecare rând sunt numerotați de la 1 la n, ca în imaginea de mai jos:

O veveriță jucăușă sare prin copaci astfel:
1;i într-un copac numerotat cu i+1. Dacă se află într-un copac de pe rândul A sau de pe rândul C, va sări în copacul de pe rândul B, iar dacă se află în copacul de pe răndul B, va sări în copacul de pe rândul A sau în copacul de pe rândul C;n.Aflați numărul M de modalități în care se poate deplasa veverița, respectând regulile de mai sus. Dacă n este mai mic sau egal cu 1000, atunci veți afișa chiar numărul M, iar dacă n este mai mare decât 1000, veți afișa restul împărțirii lui M la 666013.
| Problema | Veverita | Operații I/O |
veverita.in/veverita.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64643491 | Utilizator | |
| Fișier | veverita.cpp | Dimensiune | 5.42 KB |
| Data încărcării | 20 Mai 2026, 09:38 | Scor/rezultat | 35 puncte |
veverita.cpp: In function ‘long long unsigned int putere(int, int)’: veverita.cpp:91:12: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 91 | while (b > produs) { | ~~^~~~~~~~ veverita.cpp:97:16: warning: comparison of integer expressions of different signedness: ‘long long unsigned int’ and ‘int’ [-Wsign-compare] 97 | if (produs <= b) { | ~~~~~~~^~~~ veverita.cpp: In function ‘int PB_ceva()’: veverita.cpp:120:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 120 | for (int i = 0; i < strlen(n); i++) { | ~~^~~~~~~~~~~ veverita.cpp:121:13: warning: array subscript has type ‘char’ [-Wchar-subscripts] 121 | freq[n[i]]++; | ~~~^ veverita.cpp:124:14: warning: array subscript has type ‘char’ [-Wchar-subscripts] 124 | if (freq[i] > 1) { | ^ veverita.cpp:125:37: warning: array subscript has type ‘char’ [-Wchar-subscripts] 125 | suma /= Permutari_cu_mod(freq[i]); | ^ veverita.cpp:117:7: warning: unused variable ‘k’ [-Wunused-variable] 117 | int k; | ^ veverita.cpp: In function ‘int descompunere_factori_factoriale()’: veverita.cpp:137:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 137 | for (int i = max(b, c) + 1; i <= a; i++) { | ~~^~~~ veverita.cpp:148:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const long long unsigned int’ [-Wsign-compare] 148 | for (int i = 2; i <= min(b, c); i++) { | ~~^~~~~~~~~~~~ veverita.cpp:161:1: warning: no return statement in function returning non-void [-Wreturn-type] 161 | } | ^ veverita.cpp: In function ‘int ma2in()’: veverita.cpp:168:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 168 | for (int i = max(b, c) + 1; i <= a; i++) { | ~~^~~~ veverita.cpp:175:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const long long unsigned int’ [-Wsign-compare] 175 | for (int i = 2; i <= min(b, c); i++) { | ~~^~~~~~~~~~~~ veverita.cpp:165:27: warning: unused variable ‘cntc’ [-Wunused-variable] 165 | int cnta = 0, cntb = 0, cntc = 0; | ^~~~ veverita.cpp:188:1: warning: no return statement in function returning non-void [-Wreturn-type] 188 | } | ^ veverita.cpp: In function ‘int pb_3630_30_limita_de_timp_depasita()’: veverita.cpp:230:27: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘long long unsigned int’ [-Wsign-compare] 230 | for (long long i = 1; i <= n; i++) { | ~~^~~~ veverita.cpp:237:1: warning: no return statement in function returning non-void [-Wreturn-type] 237 | } | ^ veverita.cpp: In function ‘int pb_1297()’: veverita.cpp:254:1: warning: no return statement in function returning non-void [-Wreturn-type] 254 | } | ^ veverita.cpp: In function ‘int prob4812()’: veverita.cpp:225:1: warning: control reaches end of non-void function [-Wreturn-type] 225 | } | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | OK. | 5 | 5 | Exemplu | |
| 2 | 0.004 secunde | OK. | 5 | 5 | ||
| 3 | 0.002 secunde | OK. | 5 | 5 | ||
| 4 | 0.002 secunde | Raspuns gresit. | 5 | 0 | ||
| 5 | 0.002 secunde | Raspuns gresit. | 5 | 0 | ||
| 6 | 0.004 secunde | Raspuns gresit. | 5 | 0 | ||
| 7 | 0.002 secunde | Raspuns gresit. | 5 | 0 | ||
| 8 | 0.002 secunde | Raspuns gresit. | 5 | 0 | ||
| 9 | 0.002 secunde | Raspuns gresit. | 5 | 0 | ||
| 10 | 0.002 secunde | Raspuns gresit. | 5 | 0 | ||
| 11 | 0.004 secunde | Raspuns gresit. | 5 | 0 | ||
| 12 | 0.002 secunde | Raspuns gresit. | 5 | 0 | ||
| 13 | 0.002 secunde | OK. | 5 | 5 | ||
| 14 | 0.002 secunde | OK. | 5 | 5 | ||
| 15 | 0.002 secunde | OK. | 5 | 5 | ||
| 16 | 0.002 secunde | OK. | 5 | 5 | Exemplu | |
| 17 | 0.002 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 18 | 0.002 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 19 | 0.002 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 20 | 0.002 secunde | Caught fatal signal 11 | 5 | 0 | ||
| Punctaj total | 35 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Veverita 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ă.