#4957
Se dă un graf neorientat cu n vârfuri și m muchii. Să se afișeze vârfurile grafului dat în ordine crescătoare a gradelor. Vârfurile cu același grad se afișează în ordine crescătoare a valorii lor.
| Problema | GradeXI | Operații I/O |
gradexi.in/gradexi.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64994527 | Utilizator | |
| Fișier | gradexi.cpp | Dimensiune | 714 B |
| Data încărcării | 08 Iulie 2026, 08:27 | Scor/rezultat | Eroare de compilare |
gradexi.cpp: In function ‘int main()’: gradexi.cpp:22:20: error: invalid types ‘int[int]’ for array subscript 22 | if(gr[n[i]]>gr[n[j]] || (gr[n[i]==gr[n[j]]) || gr[n[i]<gr[n[j]] && n[i]>n[j]) | ^ gradexi.cpp:22:29: error: invalid types ‘int[int]’ for array subscript 22 | if(gr[n[i]]>gr[n[j]] || (gr[n[i]==gr[n[j]]) || gr[n[i]<gr[n[j]] && n[i]>n[j]) | ^ gradexi.cpp:22:42: error: invalid types ‘int[int]’ for array subscript 22 | if(gr[n[i]]>gr[n[j]] || (gr[n[i]==gr[n[j]]) || gr[n[i]<gr[n[j]] && n[i]>n[j]) | ^ gradexi.cpp:22:51: error: invalid types ‘int[int]’ for array subscript 22 | if(gr[n[i]]>gr[n[j]] || (gr[n[i]==gr[n[j]]) || gr[n[i]<gr[n[j]] && n[i]>n[j]) | ^ gradexi.cpp:22:55: error: expected ‘]’ before ‘)’ token 22 | if(gr[n[i]]>gr[n[j]] || (gr[n[i]==gr[n[j]]) || gr[n[i]<gr[n[j]] && n[i]>n[j]) | ^ | ] gradexi.cpp:22:64: error: invalid types ‘int[int]’ for array subscript 22 | if(gr[n[i]]>gr[n[j]] || (gr[n[i]==gr[n[j]]) || gr[n[i]<gr[n[j]] && n[i]>n[j]) | ^ gradexi.cpp:22:72: error: invalid types ‘int[int]’ for array subscript 22 | if(gr[n[i]]>gr[n[j]] || (gr[n[i]==gr[n[j]]) || gr[n[i]<gr[n[j]] && n[i]>n[j]) | ^ gradexi.cpp:22:81: error: invalid types ‘int[int]’ for array subscript 22 | if(gr[n[i]]>gr[n[j]] || (gr[n[i]==gr[n[j]]) || gr[n[i]<gr[n[j]] && n[i]>n[j]) | ^ gradexi.cpp:22:86: error: invalid types ‘int[int]’ for array subscript 22 | if(gr[n[i]]>gr[n[j]] || (gr[n[i]==gr[n[j]]) || gr[n[i]<gr[n[j]] && n[i]>n[j]) | ^ gradexi.cpp:22:89: error: expected ‘]’ before ‘)’ token 22 | if(gr[n[i]]>gr[n[j]] || (gr[n[i]==gr[n[j]]) || gr[n[i]<gr[n[j]] && n[i]>n[j]) | ^ | ] gradexi.cpp:24:22: error: invalid types ‘int[int]’ for array subscript 24 | int aux=n[i]; | ^ gradexi.cpp:25:18: error: invalid types ‘int[int]’ for array subscript 25 | n[i]=n[j]; | ^ gradexi.cpp:25:23: error: invalid types ‘int[int]’ for array subscript 25 | n[i]=n[j]; | ^ gradexi.cpp:26:18: error: invalid types ‘int[int]’ for array subscript 26 | n[j]=aux; | ^ gradexi.cpp:31:13: error: invalid types ‘int[int]’ for array subscript 31 | g<<n[i]<<" "; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GradeXI 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ă.