6454 | 2023-12-01 12:00:37 | Gervid | Szomjas állatok | cpp17 | Compilation error |
#include <iostream>
#include <queue>
using namespace std;
int main()
{
int n, i, current;
cin >> n;
priority_queue<int, vector<int>, greater<>> atriver;
atriver.push(INT_MAX);
for (i = 0; i < n; i++)
{
cin >> current;
while (atriver.top() < current)
{
atriver.pop();
}
atriver.push(current);
}
cout << atriver.size()-1;
}
exit status 1
main.cpp: In function 'int main()':
main.cpp:12:22: error: 'INT_MAX' was not declared in this scope
12 | atriver.push(INT_MAX);
| ^~~~~~~
main.cpp:3:1: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
2 | #include <queue>
+++ |+#include <climits>
3 |
Exited with error status 1