Borderou de evaluare (job #3292698)
Utilizator | Data | 8 aprilie 2025 23:47:47 | |
---|---|---|---|
Problema | Parcurgere DFS - componente conexe | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:8:14: error: conflicting declaration 'std::vector<int> g [100005]'
8 | vector <int> g[100005];
| ^
main.cpp:6:10: note: previous declaration as 'std::ofstream g'
6 | ofstream g("dfs.out");
| ^
main.cpp: In function 'void dfs(int)':
main.cpp:15:20: error: no match for 'operator[]' (operand types are 'std::ofstream' {aka 'std::basic_ofstream<char>'} and 'int')
15 | for (auto vec:g[nod] )
| ^
main.cpp: In function 'int main()':
main.cpp:27:10: error: no match for 'operator[]' (operand types are 'std::ofstream' {aka 'std::basic_ofstream<char>'} and 'int')
27 | g[x].push_back(y);
| ^
main.cpp:28:10: error: no match for 'operator[]' (operand types are 'std::ofstream' {aka 'std::basic_ofstream<char>'} and 'int')
28 | g[y].push_back(x);
| ^
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !