Borderou de evaluare (job #3205908)

Utilizator TeddyDinutaDinuta Eduard Stefan TeddyDinuta Data 20 februarie 2024 22:28:57
Problema Arbore partial de cost minim Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp:7:34: error: 'int link [200005]' redeclared as different kind of entity 7 | int min_edge[200005], link[200005]; | ^ In file included from /usr/include/bits/sigstksz.h:24, from /usr/include/signal.h:328, from /usr/include/c++/12.2.1/csignal:42, from /usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/stdc++.h:43, from main.cpp:1: /usr/include/unistd.h:819:12: note: previous declaration 'int link(const char*, const char*)' 819 | extern int link (const char *__from, const char *__to) | ^~~~ main.cpp: In function 'void prim(int)': main.cpp:16:15: warning: pointer to a function used in arithmetic [-Wpointer-arith] 16 | link[i] = -1; | ^ main.cpp:16:17: error: assignment of read-only location '*(link + ((sizetype)i))' 16 | link[i] = -1; | ~~~~~~~~^~~~ main.cpp:31:19: warning: pointer to a function used in arithmetic [-Wpointer-arith] 31 | if (link[x] != -1) { | ^ main.cpp:31:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 31 | if (link[x] != -1) { | ~~~~~~~~^~~~~ main.cpp:32:34: warning: pointer to a function used in arithmetic [-Wpointer-arith] 32 | ans.push_back({link[x], x}); | ^ main.cpp:32:26: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(<brace-enclosed initializer list>)' 32 | ans.push_back({link[x], x}); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/12.2.1/vector:64, from /usr/include/c++/12.2.1/functional:62, from /usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/stdc++.h:71: /usr/include/c++/12.2.1/bits/stl_vector.h:1276:7: note: candidate: 'constexpr void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]' 1276 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1276:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<std::pair<int, int> >::value_type&' {aka 'const std::pair<int, int>&'} 1276 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1293:7: note: candidate: 'constexpr void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]' 1293 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1293:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'} 1293 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ main.cpp:41:30: warning: pointer to a function used in arithmetic [-Wpointer-arith] 41 | link[it.first] = x; | ^ main.cpp:41:32: error: assignment of read-only location '*(link + ((sizetype)it.std::pair<int, int>::first))' 41 | link[it.first] = x; Non zero exit status: 1

Ceva nu functioneaza?