Borderou de evaluare (job #2932586)
Utilizator | Data | 3 noiembrie 2022 10:50:06 | |
---|---|---|---|
Problema | Componente tare conexe | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:10:5: error: 'int index' redeclared as different kind of entity
10 | int index=1; //numarul de comp tari conexe
| ^~~~~
In file included from /usr/include/string.h:432,
from /usr/include/c++/10/cstring:42,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:48,
from main.cpp:1:
/usr/include/strings.h:61:1: note: previous declaration 'const char* index(const char*, int)'
61 | index (const char *__s, int __c) __THROW
| ^~~~~
main.cpp: In function 'void DFS_t(std::vector<std::vector<int> >, int, int, int)':
main.cpp:20:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
20 | for(int i = 0; i < graph_t[x].size(); i ++){
| ~~^~~~~~~~~~~~~~~~~~~
main.cpp: In function 'void DFS(std::vector<std::vector<int> >, int, int)':
main.cpp:29:18: error: cannot resolve overloaded function 'index' based on conversion to type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
29 | visited[x] = index;
| ^~~~~
main.cpp:30:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
30 | for(int i = 0; i < graph[x].size(); i ++){
| ~~^~~~~~~~~~~~~~~~~
main.cpp: In function 'int main()':
main.cpp:68:39: error: cannot resolve overloaded function 'index' based on conversion to type 'int'
68 | DFS_t(graph_t, n, x, index);
| ^
main.cpp:70:31: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and '<unresolved overloaded function type>' to binary 'operator=='
70 | if(visited[i] == index){
main.cpp:75:22: error: overloaded function with no contextual type information
75 | index += 1;
| ^
main.cpp:78:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
78 | g << index - 1 << endl; // afisam nr de comp tari conexe
| ~~~~~~^~~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !