#2702
Andrei lucrează într-un magazin de șosete, iar fiecare șosetă are asociat un numar întreg pentru a o identifica mai ușor din ce model face parte. Dându-se un vector neordonat de astfel de coduri, aflați câte perechi de șosete se pot forma.
hackerrank.com
| Problema | PerechiSosete | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64817788 | Utilizator | |
| Fișier | perechisosete.cpp | Dimensiune | 359 B |
| Data încărcării | 03 Iunie 2026, 12:44 | Scor/rezultat | 0 puncte |
perechisosete.cpp: In function ‘int main()’: perechisosete.cpp:6:25: warning: unused variable ‘s1’ [-Wunused-variable] 6 | {long long a[100]={0},s,s1,x,y,k,r,v,ok,b[15001],m,c,c1; | ^~ perechisosete.cpp:6:30: warning: variable ‘y’ set but not used [-Wunused-but-set-variable] 6 | {long long a[100]={0},s,s1,x,y,k,r,v,ok,b[15001],m,c,c1; | ^ perechisosete.cpp:6:32: warning: variable ‘k’ set but not used [-Wunused-but-set-variable] 6 | {long long a[100]={0},s,s1,x,y,k,r,v,ok,b[15001],m,c,c1; | ^ perechisosete.cpp:6:34: warning: unused variable ‘r’ [-Wunused-variable] 6 | {long long a[100]={0},s,s1,x,y,k,r,v,ok,b[15001],m,c,c1; | ^ perechisosete.cpp:6:36: warning: unused variable ‘v’ [-Wunused-variable] 6 | {long long a[100]={0},s,s1,x,y,k,r,v,ok,b[15001],m,c,c1; | ^ perechisosete.cpp:6:38: warning: unused variable ‘ok’ [-Wunused-variable] 6 | {long long a[100]={0},s,s1,x,y,k,r,v,ok,b[15001],m,c,c1; | ^~ perechisosete.cpp:6:41: warning: unused variable ‘b’ [-Wunused-variable] 6 | {long long a[100]={0},s,s1,x,y,k,r,v,ok,b[15001],m,c,c1; | ^ perechisosete.cpp:6:50: warning: unused variable ‘m’ [-Wunused-variable] 6 | {long long a[100]={0},s,s1,x,y,k,r,v,ok,b[15001],m,c,c1; | ^ perechisosete.cpp:6:52: warning: unused variable ‘c’ [-Wunused-variable] 6 | {long long a[100]={0},s,s1,x,y,k,r,v,ok,b[15001],m,c,c1; | ^ perechisosete.cpp:6:54: warning: unused variable ‘c1’ [-Wunused-variable] 6 | {long long a[100]={0},s,s1,x,y,k,r,v,ok,b[15001],m,c,c1; | ^~ perechisosete.cpp:17:11: warning: iteration 99 invokes undefined behavior [-Waggressive-loop-optimizations] 17 | if(a[i]>=2){ | ~~~^ perechisosete.cpp:16:11: note: within this loop 16 | for(i=1; i<=100; i++){ | ~^~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.003 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PerechiSosete 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ă.