Borderou de evaluare (job #2956857)
Utilizator | Data | 20 decembrie 2022 21:09:19 | |
---|---|---|---|
Problema | Sortare topologica | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:15:32: error: 'std::stack' has not been declared
15 | void dfs(const int k, std::stack<int> &s){
| ^~~~~
main.cpp:15:37: error: expected ',' or '...' before '<' token
15 | void dfs(const int k, std::stack<int> &s){
| ^
main.cpp:59:10: error: 'stack' in namespace 'std' does not name a template type
59 | std::stack<int> topologicalSort() {
| ^~~~~
main.cpp:5:1: note: 'std::stack' is defined in header '<stack>'; did you forget to '#include <stack>'?
4 | #include <fstream>
+++ |+#include <stack>
5 |
main.cpp: In member function 'void Graph::dfs(int, int)':
main.cpp:20:27: error: 's' was not declared in this scope
20 | dfs(node, s);
| ^
main.cpp:23:9: error: 's' was not declared in this scope
23 | s.push(k);
| ^
main.cpp: In member function 'int Graph::getEdgeWeight(int, int) const':
main.cpp:39:26: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
39 | for (const auto& [neighbor, weight] : graph[x]) {
| ^
main.cpp: In member function 'std::vector<int> Graph::getNeighbors(int) const':
main.cpp:49:26: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
49 | for (const auto& [neighbor, weight] : graph[x]) {
| ^
main.cpp: In function 'int main()':
main.cpp:84:5: error: 'stack' was not declared in this scope
84 | stack<int> sorted = g.topologicalSort();
| ^~~~~
main.cpp:84:5: note: 'std::stack' is defined in header '<stack>'; did you forget to '#include <stack>'?
main.cpp:84:11: error: expected primary-expression before 'int'
84 | stack<int> sorted = g.topologicalSort();
| ^~~
main.cpp:85:13: error: 'sorted' was not declared in this scope; did you mean 'strtod'?
85 | while (!sorted.empty()){
| ^~~~~~
| strtod
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !