#3304
Vasilica şi Viorica au primit cadou de la moşul un joc cu n jetoane pe care sunt scrise nişte numere. Cerinţa jocului este să afle dacă se pot alege câteva jetoane astfel încât produsul numerelor să fie 2020.
NeuroN
| Problema | douazecidouazeci | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64222272 | Utilizator | |
| Fișier | douazecidouazeci.cpp | Dimensiune | 721 B |
| Data încărcării | 23 Aprilie 2026, 17:53 | Scor/rezultat | 96 puncte |
douazecidouazeci.cpp: In function ‘int main()’: douazecidouazeci.cpp:17:32: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 17 | if(ap[2020]!=0 || ap[2]!=0 && ap[1010]!=0 || ap[4]!=0 && ap[505]!=0 || ap[10]!=0 && ap[202]!=0 || ap[20]!=0 && ap[101]!=0 || ap[2]>1 && ap[505]!=0 || ap[2]!=0 && ap[5]!=0 && ap[202]!=0 || ap[4]!=0 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]!=0 && ap[10]!=0 && ap[101]!=0) | ~~~~~~~~~^~~~~~~~~~~~~~ douazecidouazeci.cpp:17:59: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 17 | if(ap[2020]!=0 || ap[2]!=0 && ap[1010]!=0 || ap[4]!=0 && ap[505]!=0 || ap[10]!=0 && ap[202]!=0 || ap[20]!=0 && ap[101]!=0 || ap[2]>1 && ap[505]!=0 || ap[2]!=0 && ap[5]!=0 && ap[202]!=0 || ap[4]!=0 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]!=0 && ap[10]!=0 && ap[101]!=0) | ~~~~~~~~~^~~~~~~~~~~~~ douazecidouazeci.cpp:17:86: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 17 | if(ap[2020]!=0 || ap[2]!=0 && ap[1010]!=0 || ap[4]!=0 && ap[505]!=0 || ap[10]!=0 && ap[202]!=0 || ap[20]!=0 && ap[101]!=0 || ap[2]>1 && ap[505]!=0 || ap[2]!=0 && ap[5]!=0 && ap[202]!=0 || ap[4]!=0 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]!=0 && ap[10]!=0 && ap[101]!=0) | ~~~~~~~~~~^~~~~~~~~~~~~ douazecidouazeci.cpp:17:113: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 17 | if(ap[2020]!=0 || ap[2]!=0 && ap[1010]!=0 || ap[4]!=0 && ap[505]!=0 || ap[10]!=0 && ap[202]!=0 || ap[20]!=0 && ap[101]!=0 || ap[2]>1 && ap[505]!=0 || ap[2]!=0 && ap[5]!=0 && ap[202]!=0 || ap[4]!=0 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]!=0 && ap[10]!=0 && ap[101]!=0) | ~~~~~~~~~~^~~~~~~~~~~~~ douazecidouazeci.cpp:17:138: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 17 | if(ap[2020]!=0 || ap[2]!=0 && ap[1010]!=0 || ap[4]!=0 && ap[505]!=0 || ap[10]!=0 && ap[202]!=0 || ap[20]!=0 && ap[101]!=0 || ap[2]>1 && ap[505]!=0 || ap[2]!=0 && ap[5]!=0 && ap[202]!=0 || ap[4]!=0 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]!=0 && ap[10]!=0 && ap[101]!=0) | ~~~~~~~~^~~~~~~~~~~~~ douazecidouazeci.cpp:17:176: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 17 | if(ap[2020]!=0 || ap[2]!=0 && ap[1010]!=0 || ap[4]!=0 && ap[505]!=0 || ap[10]!=0 && ap[202]!=0 || ap[20]!=0 && ap[101]!=0 || ap[2]>1 && ap[505]!=0 || ap[2]!=0 && ap[5]!=0 && ap[202]!=0 || ap[4]!=0 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]!=0 && ap[10]!=0 && ap[101]!=0) | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ douazecidouazeci.cpp:17:214: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 17 | if(ap[2020]!=0 || ap[2]!=0 && ap[1010]!=0 || ap[4]!=0 && ap[505]!=0 || ap[10]!=0 && ap[202]!=0 || ap[20]!=0 && ap[101]!=0 || ap[2]>1 && ap[505]!=0 || ap[2]!=0 && ap[5]!=0 && ap[202]!=0 || ap[4]!=0 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]!=0 && ap[10]!=0 && ap[101]!=0) | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ douazecidouazeci.cpp:17:251: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 17 | if(ap[2020]!=0 || ap[2]!=0 && ap[1010]!=0 || ap[4]!=0 && ap[505]!=0 || ap[10]!=0 && ap[202]!=0 || ap[20]!=0 && ap[101]!=0 || ap[2]>1 && ap[505]!=0 || ap[2]!=0 && ap[5]!=0 && ap[202]!=0 || ap[4]!=0 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]!=0 && ap[10]!=0 && ap[101]!=0) | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ douazecidouazeci.cpp:17:288: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 17 | if(ap[2020]!=0 || ap[2]!=0 && ap[1010]!=0 || ap[4]!=0 && ap[505]!=0 || ap[10]!=0 && ap[202]!=0 || ap[20]!=0 && ap[101]!=0 || ap[2]>1 && ap[505]!=0 || ap[2]!=0 && ap[5]!=0 && ap[202]!=0 || ap[4]!=0 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]!=0 && ap[10]!=0 && ap[101]!=0) | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ douazecidouazeci.cpp:17:327: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 17 | if(ap[2020]!=0 || ap[2]!=0 && ap[1010]!=0 || ap[4]!=0 && ap[505]!=0 || ap[10]!=0 && ap[202]!=0 || ap[20]!=0 && ap[101]!=0 || ap[2]>1 && ap[505]!=0 || ap[2]!=0 && ap[5]!=0 && ap[202]!=0 || ap[4]!=0 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]>1 && ap[5]!=0 && ap[101]!=0 || ap[2]!=0 && ap[10]!=0 && ap[101]!=0) | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ douazecidouazeci.cpp:10:13: warning: unused variable ‘j’ [-Wunused-variable] 10 | int i,n,j,x,ap[2021]={0}; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 4 | 4 | Exemplu | |
| 2 | 0.002 secunde | OK. | 4 | 4 | ||
| 3 | 0.001 secunde | OK. | 4 | 4 | ||
| 4 | 0.001 secunde | OK. | 4 | 4 | ||
| 5 | 0.001 secunde | OK. | 4 | 4 | ||
| 6 | 0.002 secunde | OK. | 4 | 4 | ||
| 7 | 0.002 secunde | OK. | 4 | 4 | ||
| 8 | 0.002 secunde | OK. | 4 | 4 | ||
| 9 | 0.001 secunde | OK. | 4 | 4 | ||
| 10 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 11 | 0.001 secunde | OK. | 4 | 4 | ||
| 12 | 0.001 secunde | OK. | 4 | 4 | ||
| 13 | 0.001 secunde | OK. | 4 | 4 | ||
| 14 | 0.001 secunde | OK. | 4 | 4 | ||
| 15 | 0.001 secunde | OK. | 4 | 4 | ||
| 16 | 0.002 secunde | OK. | 4 | 4 | ||
| 17 | 0.002 secunde | OK. | 4 | 4 | ||
| 18 | 0.002 secunde | OK. | 4 | 4 | ||
| 19 | 0.002 secunde | OK. | 4 | 4 | ||
| 20 | 0.001 secunde | OK. | 4 | 4 | ||
| 21 | 0.001 secunde | OK. | 4 | 4 | ||
| 22 | 0.001 secunde | OK. | 4 | 4 | ||
| 23 | 0.001 secunde | OK. | 4 | 4 | ||
| 24 | 0.001 secunde | OK. | 4 | 4 | ||
| 25 | 0.001 secunde | OK. | 4 | 4 | ||
| Punctaj total | 96 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema douazecidouazeci 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ă.