| 22576 | 2026-01-15 11:29:47 | KassayAkos | Hőségriadó (50 pont) | cpp17 | Compilation error |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, l, f;
cin >> n >> k >> l >> f;
vector <int> a(n, 0);
int akthoseg=0, akthideg=0;
bool hosegriadovan=false;
int db=0;
for (int i=0;i<n;i++)
{
cin >> a[i];
if (a[i]>f)
{
akthoseg++;
akthideg=0;
}
else if (a[i]<f)
{
akthideg++;
akthoseg=0;
}
else
{
akthideg=0;
akthoseg=0;
}
if (akthoseg==k)
{
if !(hosegriado)
{
db++;
}
hosegriadovan=true;
}
if (akthideg==l)
{
hosegriadovan=false;
}
}
cout<<db;
return 0;
}
open /var/local/lib/isolate/431/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:33:16: error: expected '(' before '!' token
33 | if !(hosegriado)
| ^
| (