#502
Se dă un vector cu n elemente numere naturale. Să se verifice dacă oricare două elemente ale vectorului sunt diferite.
| Problema | VerifDiferite | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64893477 | Utilizator | |
| Fișier | verifdiferite.cpp | Dimensiune | 329 B |
| Data încărcării | 10 Iunie 2026, 09:37 | Scor/rezultat | 50 puncte |
verifdiferite.cpp: In function ‘int main()’: verifdiferite.cpp:17:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 17 | if(v[i]=v[j]) | ~~~~^~~~~ verifdiferite.cpp:21:5: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 21 | if(b=1) | ~^~ verifdiferite.cpp:23:1: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 23 | else | ^~~~ verifdiferite.cpp:25:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 25 | return 0; | ^~~~~~ verifdiferite.cpp:6:14: warning: unused variable ‘x’ [-Wunused-variable] 6 | {int v[1001],x[1001],n,b,i,m=0,d,prim,j; | ^ verifdiferite.cpp:6:28: warning: unused variable ‘m’ [-Wunused-variable] 6 | {int v[1001],x[1001],n,b,i,m=0,d,prim,j; | ^ verifdiferite.cpp:6:32: warning: unused variable ‘d’ [-Wunused-variable] 6 | {int v[1001],x[1001],n,b,i,m=0,d,prim,j; | ^ verifdiferite.cpp:6:34: warning: unused variable ‘prim’ [-Wunused-variable] 6 | {int v[1001],x[1001],n,b,i,m=0,d,prim,j; | ^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 30 | 30 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 30 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 50 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema VerifDiferite 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ă.