제출 #1310484

#제출 시각아이디문제언어결과실행 시간메모리
1310484dgarcia09Telefoni (COCI17_telefoni)C++20
8 / 80
10 ms2768 KiB
#include <bits/stdc++.h> #pragma GCC optimize ("O2") #define int long long #define endl '\n' #define fr first #define sc second #define vc vector<int> using namespace std; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.setf(ios::fixed); cout.precision(0); int n, d; cin >> n >> d; vc num(n+1); int pos = 1; bool ok = true; for(int i = 1; i <= n; i++){ cin >> num[i]; if(num[i] == 1 && num[i-1] != 0){ pos++; }else{ ok = false; } } int cont = 0; for(int i = pos; i <= n; i += d){ if(num[i] == 0){ cont++; } } cout << cont << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...