실행 실패 (제출 코드 컴파일 에러)
Main.cpp: In function ‘int main()’: Main.cpp:16:40: error: no type named ‘value_type’ in ‘struct std::greater<int>’ 16 | priority_queue<long long, greater<int>> pq; | ^~ Main.cpp:16:40: error: template argument 3 is invalid Main.cpp:19:8: error: request for member ‘push’ in ‘pq’, which is of non-class type ‘int’ 19 | pq.push(a); | ^~~~ Main.cpp:26:12: error: request for member ‘top’ in ‘pq’, which is of non-class type ‘int’ 26 | x = pq.top(); | ^~~ Main.cpp:27:8: error: request for member ‘pop’ in ‘pq’, which is of non-class type ‘int’ 27 | pq.pop(); | ^~~ Main.cpp:29:20: error: request for member ‘top’ in ‘pq’, which is of non-class type ‘int’ 29 | while (x == pq.top()) { | ^~~ Main.cpp:30:17: error: request for member ‘top’ in ‘pq’, which is of non-class type ‘int’ 30 | q.push(pq.top()); | ^~~ Main.cpp:31:10: error: request for member ‘pop’ in ‘pq’, which is of non-class type ‘int’ 31 | pq.pop(); | ^~~ Main.cpp:34:13: error: request for member ‘top’ in ‘pq’, which is of non-class type ‘int’ 34 | x += pq.top(); | ^~~ Main.cpp:35:8: error: request for member ‘pop’ in ‘pq’, which is of non-class type ‘int’ 35 | pq.pop(); | ^~~ Main.cpp:38:10: error: request for member ‘push’ in ‘pq’, which is of non-class type ‘int’ 38 | pq.push(q.front()); | ^~~~ Main.cpp:42:8: error: request for member ‘push’ in ‘pq’, which is of non-class type ‘int’ 42 | pq.push(x); | ^~~~ Main.cpp:43:8: error: request for member ‘push’ in ‘pq’, which is of non-class type ‘int’ 43 | pq.push(x); | ^~~~ Main.cpp:47:14: error: request for member ‘empty’ in ‘pq’, which is of non-class type ‘int’ 47 | while (!pq.empty()) { | ^~~~~ Main.cpp:48:18: error: request for member ‘top’ in ‘pq’, which is of non-class type ‘int’ 48 | result += pq.top(); | ^~~ Main.cpp:49:8: error: request for member ‘pop’ in ‘pq’, which is of non-class type ‘int’ 49 | pq.pop(); | ^~~
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.