#293
Se dă un şir cu n elemente, numere naturale. Să se verifice dacă toate elementele şirului au toate cifrele distincte.
| Problema | CifreDistincte | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64565442 | Utilizator | |
| Fișier | cifredistincte.cpp | Dimensiune | 437 B |
| Data încărcării | 14 Mai 2026, 15:45 | Scor/rezultat | 50 puncte |
cifredistincte.cpp: In function ‘int main()’: cifredistincte.cpp:7:18: warning: unused variable ‘f’ [-Wunused-variable] 7 | int n, j, a, f, i, ok=1, v[9]; cin>>n; | ^ cifredistincte.cpp:15:19: warning: iteration 9 invokes undefined behavior [-Waggressive-loop-optimizations] 15 | if(v[j]>1) | ~~~^ cifredistincte.cpp:14:18: note: within this loop 14 | for(j=0;j<10;j++) | ~^~~ cifredistincte.cpp:18:17: warning: iteration 9 invokes undefined behavior [-Waggressive-loop-optimizations] 18 | v[j]=0; | ~~~~^~ cifredistincte.cpp:17:18: note: within this loop 17 | for(j=0;j<10;j++) | ~^~~ cifredistincte.cpp:18:17: warning: ‘void* __builtin_memset(void*, int, long unsigned int)’ forming offset [36, 39] is out of the bounds [0, 36] of object ‘v’ with type ‘int [9]’ [-Warray-bounds=] 18 | v[j]=0; | ~~~~^~ cifredistincte.cpp:7:30: note: ‘v’ declared here 7 | int n, j, a, f, i, ok=1, v[9]; cin>>n; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 4 | 0.001 secunde | OK. | 10 | 10 | ||
| 5 | 0.001 secunde | OK. | 20 | 20 | ||
| 6 | 0.001 secunde | OK. | 10 | 10 | ||
| 7 | 0.001 secunde | OK. | 10 | 10 | ||
| Punctaj total | 50 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CifreDistincte 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ă.