제출 #1271721

#제출 시각아이디문제언어결과실행 시간메모리
1271721dairon44Telefoni (COCI17_telefoni)C++20
80 / 80
9 ms1608 KiB
/* @_@ Smile :) */ #include <bits/stdc++.h> #define ll long long #define f first #define s second #define mk make_pair #define pb push_back #define pop pop_back using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int N, D; cin >> N >> D; int A[N]; for(int i = 0;i < N;i++) cin >> A[i]; int suma = 0, aux = D; for(int i = 0;i < N;i++){ if(A[i] == 1) aux = D; if(A[i] == 0) aux--; if(aux == 0){ aux = D; suma++; } } cout << suma << '\n'; return 0; } /* (N * (N + 1)) / 2 double pi = acos(-1); */ // 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37 // j %
#Verdict Execution timeMemoryGrader output
Fetching results...