#1005
Se dă o listă cu numere naturale. Să se determine numerele naturale nenule cu cel mult patru cifre care nu apar în lista dată.
| Problema | Numere8 | Operații I/O |
numere8.in/numere8.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64161385 | Utilizator | |
| Fișier | numere8.cpp | Dimensiune | 448 B |
| Data încărcării | 21 Aprilie 2026, 09:20 | Scor/rezultat | Eroare de compilare |
numere8.cpp: In function ‘int main()’: numere8.cpp:7:12: error: the value of ‘nmax’ is not usable in a constant expression 7 | bitset<nmax> b1,b2; | ^~~~ numere8.cpp:6:20: note: ‘int nmax’ is not const 6 | int x,sol=0,mn,nmax,mx=0,i; | ^~~~ numere8.cpp:7:16: error: the value of ‘nmax’ is not usable in a constant expression 7 | bitset<nmax> b1,b2; | ^ numere8.cpp:6:20: note: ‘int nmax’ is not const 6 | int x,sol=0,mn,nmax,mx=0,i; | ^~~~ numere8.cpp:7:16: note: in template argument for type ‘long unsigned int’ 7 | bitset<nmax> b1,b2; | ^ numere8.cpp:14:15: error: invalid types ‘int[int]’ for array subscript 14 | if (b1[x]==1) | ^ numere8.cpp:15:15: error: invalid types ‘int[int]’ for array subscript 15 | b2[x]=1; | ^ numere8.cpp:17:15: error: invalid types ‘int[int]’ for array subscript 17 | b1[x]=1; | ^ numere8.cpp:19:16: warning: right operand of comma operator has no effect [-Wunused-value] 19 | for (i=mn,i<=mx,i++) | ~^~~~ numere8.cpp:19:24: error: expected ‘;’ before ‘)’ token 19 | for (i=mn,i<=mx,i++) | ^ | ; numere8.cpp:25:1: error: expected primary-expression before ‘}’ token 25 | } | ^ numere8.cpp:24:15: error: expected ‘)’ before ‘}’ token 24 | cout<<sol; | ^ | ) 25 | } | ~ numere8.cpp:19:9: note: to match this ‘(’ 19 | for (i=mn,i<=mx,i++) | ^ numere8.cpp:25:1: error: expected primary-expression before ‘}’ token 25 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Numere8 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ă.