# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1244280 | minhpk | Telefoni (COCI17_telefoni) | C++20 | 8 ms | 328 KiB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
int a,b;
vector <int> z;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> a >> b;
for (int i=1;i<=a;i++){
int x;
cin >> x;
if (x==1){
z.push_back(i);
}
}
int res=0;
for (int i=1;i<z.size();i++){
int len=z[i]-z[i-1]-1;
res+=len/b;
}
cout << res << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |