6018 | 2023-10-23 00:11:22 | hunortakacs | Utazásszervezés (75 pont) | cpp17 | Compilation error |
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int N; cin >> N; //vezetok
int K; cin >> K; //szezon
int M; cin >> M; //uthossz
int C; cin >> C; //igenyek
vector<int> ig(C);
for(int i=0; i<C; i++) {
cin >> ig[i]; //novekvo
}
int cnt = 0;
vector<int> utak;
int prev;
for(int indul : ig)
{
for(int i=0;i<utak.size();i++)
{
utak[i] -= (indul - prev); //dt
if(utak[i] <= 0) {
utak[i] = INT_MAX;
N++;
};
}
if(N > 0)
{
cnt++;
N--;
utak.push_back(M);
}
prev = indul;
}
cout<<cnt<<"";
return 0;
}
exit status 1
main.cpp: In function 'int main()':
main.cpp:28:27: error: 'INT_MAX' was not declared in this scope
28 | utak[i] = INT_MAX;
| ^~~~~~~
main.cpp:3:1: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
2 | #include <vector>
+++ |+#include <climits>
3 |
Exited with error status 1