6333 | 2023-11-20 10:52:32 | Ghost | Szomjas állatok | cpp17 | Forditási hiba |
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n, i, s;
cin >> n;
int out = n;
vector<int> animals(n);
for (i = 0; i < n; i++) {
cin >> animals[i];
}
for (i = 1; i < n; i++) {
for (int j = 0; j < i; j++) {
if (animals[j] != -1 && animals[j] < animals[i]) {
animals[j] = -1;
}
}
}
out -= count(animals.begin(), animals.end(), -1);
cout << out;
}
exit status 1
main.cpp: In function 'int main()':
main.cpp:24:12: error: 'count' was not declared in this scope; did you mean 'out'?
24 | out -= count(animals.begin(), animals.end(), -1);
| ^~~~~
| out
Exited with error status 1