Borderou de evaluare (job #3378241)

Utilizator yolanqaStefanescu Yolanda - Gabriela yolanqa Data 25 noiembrie 2026 16:45:41
Problema Algoritmul lui Dijkstra Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In function 'void dijkstra(int)': main.cpp:13:20: error: 'pair' was not declared in this scope; did you mean 'std::pair'? 13 | priority_queue<pair<int,int> , vector<pair<int,int>> , greater<pair<int,int>>> q; | ^~~~ | std::pair In file included from /usr/include/c++/12.2.1/string:47, from main.cpp:1: /usr/include/c++/12.2.1/bits/stl_iterator.h:2593:12: note: 'std::pair' declared here 2593 | struct pair; | ^~~~ main.cpp:13:5: error: 'priority_queue' was not declared in this scope; did you mean 'std::priority_queue'? 13 | priority_queue<pair<int,int> , vector<pair<int,int>> , greater<pair<int,int>>> q; | ^~~~~~~~~~~~~~ | std::priority_queue In file included from /usr/include/c++/12.2.1/queue:64, from main.cpp:5: /usr/include/c++/12.2.1/bits/stl_queue.h:498:11: note: 'std::priority_queue' declared here 498 | class priority_queue | ^~~~~~~~~~~~~~ main.cpp:13:25: error: expected primary-expression before 'int' 13 | priority_queue<pair<int,int> , vector<pair<int,int>> , greater<pair<int,int>>> q; | ^~~ main.cpp:14:5: error: 'q' was not declared in this scope 14 | q.push({0,node}); | ^ main.cpp: In function 'int main()': main.cpp:40:5: error: 'ifstream' was not declared in this scope; did you mean 'std::ifstream'? 40 | ifstream fin("dijkstra.in"); | ^~~~~~~~ | std::ifstream In file included from /usr/include/c++/12.2.1/bits/localefwd.h:41, from /usr/include/c++/12.2.1/string:43: /usr/include/c++/12.2.1/iosfwd:162:41: note: 'std::ifstream' declared here 162 | typedef basic_ifstream<char> ifstream; | ^~~~~~~~ main.cpp:41:5: error: 'ofstream' was not declared in this scope; did you mean 'std::ofstream'? 41 | ofstream fout("dijkstra.out"); | ^~~~~~~~ | std::ofstream /usr/include/c++/12.2.1/iosfwd:165:41: note: 'std::ofstream' declared here 165 | typedef basic_ofstream<char> ofstream; | ^~~~~~~~ main.cpp:44:5: error: 'fin' was not declared in this scope 44 | fin >> n >> m; | ^~~ main.cpp:59:13: error: 'fout' was not declared in this scope 59 | fout <<0<< ' '; | ^~~~ main.cpp:61:13: error: 'fout' was not declared in this scope 61 | fout<<dist[i] <<' '; Non zero exit status: 1

Ceva nu functioneaza?