Borderou de evaluare (job #2897864)

Utilizator anetAneta Anghel anet Data 5 mai 2022 06:50:27
Problema Heapuri Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp:12:1: error: 'vector' does not name a type 12 | vector<int> D; | ^~~~~~ main.cpp:70:2: error: 'vector' does not name a type 70 | vector<int> H, P; | ^~~~~~ main.cpp: In constructor 'Heap::Heap(int)': main.cpp:17:27: error: class 'Heap' does not have any field named 'H' 17 | Heap(int n = 0) : nH(0), H(vector<int>(n + 1)), P(vector<int>(n + 1)) | ^ main.cpp:17:29: error: 'vector' was not declared in this scope 17 | Heap(int n = 0) : nH(0), H(vector<int>(n + 1)), P(vector<int>(n + 1)) | ^~~~~~ main.cpp:5:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'? 4 | #include <algorithm> +++ |+#include <vector> 5 | using namespace std; main.cpp:17:36: error: expected primary-expression before 'int' 17 | Heap(int n = 0) : nH(0), H(vector<int>(n + 1)), P(vector<int>(n + 1)) | ^~~ main.cpp:17:50: error: class 'Heap' does not have any field named 'P' 17 | Heap(int n = 0) : nH(0), H(vector<int>(n + 1)), P(vector<int>(n + 1)) | ^ main.cpp:17:59: error: expected primary-expression before 'int' 17 | Heap(int n = 0) : nH(0), H(vector<int>(n + 1)), P(vector<int>(n + 1)) | ^~~ main.cpp: In member function 'void Heap::pop(int)': main.cpp:21:11: error: 'P' was not declared in this scope 21 | int p = P[x], s = 2 * p; | ^ main.cpp:24:11: error: 's' was not declared in this scope 24 | while ( s <= nH ) | ^ main.cpp:26:24: error: 'D' was not declared in this scope 26 | if ( s + 1 <= nH && D[H[s + 1]] < D[H[s]] ) | ^ main.cpp:26:26: error: 'H' was not declared in this scope; did you mean 'nH'? 26 | if ( s + 1 <= nH && D[H[s + 1]] < D[H[s]] ) | ^ | nH main.cpp:28:9: error: 'D' was not declared in this scope 28 | if ( D[H[s]] < D[H[p]] ) | ^ main.cpp:28:11: error: 'H' was not declared in this scope; did you mean 'nH'? 28 | if ( D[H[s]] < D[H[p]] ) | ^ | nH main.cpp: In member function 'void Heap::push(int)': main.cpp:40:3: error: 'H' was not declared in this scope; did you mean 'nH'? 40 | H[++nH] = x; P[x] = nH; Non zero exit status: 1

Ceva nu functioneaza?