| 13665 | 2025-01-08 12:30:03 | feheristvan | Virágos rét (50 pont) | cpp17 | Forditási hiba |
#include <iostream>
using namespace std;
int main()
{
int n, k, x;
cin >> n >> k;
v.resize(n);
int db = 0;
for(int i=1; i<=n; i++)
{
cin >> x;
if(x)
db++;
}
int f=db+1-k;
if(f<0)
cout << 0;
else {
int ossz=0;
for(int i=1; i<=f; i++)
ossz=ossz+i;
cout << ossz;
}
return 0;
}
open /var/local/lib/isolate/424/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:9:5: error: 'v' was not declared in this scope
9 | v.resize(n);
| ^