#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 | #64516568 | Utilizator | |
| Fișier | gradexi.cpp | Dimensiune | 922 B |
| Data încărcării | 12 Mai 2026, 09:54 | Scor/rezultat | Eroare de compilare |
gradexi.cpp: In function ‘int main()’: gradexi.cpp:41:55: error: no match for ‘operator>’ (operand types are ‘int’ and ‘nod’) 41 | else if (v[i].grad==v[j].grad && v[i].val > v[j]val) | ~~~~~~~~ ^ ~~~~ | | | | int nod In file included from /usr/include/c++/13/string:48, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44, from /usr/include/c++/13/istream:40, from /usr/include/c++/13/fstream:40, from gradexi.cpp:1: /usr/include/c++/13/bits/stl_iterator.h:469:5: note: candidate: ‘template<class _Iterator> bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)’ 469 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:469:5: note: template argument deduction/substitution failed: gradexi.cpp:41:60: note: mismatched types ‘const std::reverse_iterator<_Iterator>’ and ‘int’ 41 | else if (v[i].grad==v[j].grad && v[i].val > v[j]val) | ^ /usr/include/c++/13/bits/stl_iterator.h:514:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)’ 514 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:514:5: note: template argument deduction/substitution failed: gradexi.cpp:41:60: note: mismatched types ‘const std::reverse_iterator<_Iterator>’ and ‘int’ 41 | else if (v[i].grad==v[j].grad && v[i].val > v[j]val) | ^ /usr/include/c++/13/bits/stl_iterator.h:1725:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’ 1725 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1725:5: note: template argument deduction/substitution failed: gradexi.cpp:41:60: note: mismatched types ‘const std::move_iterator<_IteratorL>’ and ‘int’ 41 | else if (v[i].grad==v[j].grad && v[i].val > v[j]val) | ^ /usr/include/c++/13/bits/stl_iterator.h:1784:5: note: candidate: ‘template<class _Iterator> bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)’ 1784 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1784:5: note: template argument deduction/substitution failed: gradexi.cpp:41:60: note: mismatched types ‘const std::move_iterator<_IteratorL>’ and ‘int’ 41 | else if (v[i].grad==v[j].grad && v[i].val > v[j]val) | ^ In file included from /usr/include/c++/13/bits/stl_algobase.h:64, from /usr/include/c++/13/string:51: /usr/include/c++/13/bits/stl_pair.h:848:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)’ 848 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/13/bits/stl_pair.h:848:5: note: template argument deduction/substitution failed: gradexi.cpp:41:60: note: mismatched types ‘const std::pair<_T1, _T2>’ and ‘int’ 41 | else if (v[i].grad==v[j].grad && v[i].val > v[j]val) | ^ In file included from /usr/include/c++/13/string:54: /usr/include/c++/13/bits/basic_string.h:3870:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3870 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3870:5: note: template argument deduction/substitution failed: gradexi.cpp:41:60: note: mismatched types ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘int’ 41 | else if (v[i].grad==v[j].grad && v[i].val > v[j]val) | ^ /usr/include/c++/13/bits/basic_string.h:3884:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)’ 3884 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3884:5: note: template argument deduction/substitution failed: gradexi.cpp:41:60: note: mismatched types ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘int’ 41 | else if (v[i].grad==v[j].grad && v[i].val > v[j]val) | ^ /usr/include/c++/13/bits/basic_string.h:3897:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3897 | operator>(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3897:5: note: template argument deduction/substitution failed: gradexi.cpp:41:60: note: mismatched types ‘const _CharT*’ and ‘int’ 41 | else if (v[i].grad==v[j].grad && v[i].val > v[j]val) | ^ gradexi.cpp:41:61: error: expected ‘)’ before ‘val’ 41 | else if (v[i].grad==v[j].grad && v[i].val > v[j]val) | ~ ^~~ | )
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ă.