Submission #209146

#TimeUsernameProblemLanguageResultExecution timeMemory
209146cstuartTelefoni (COCI17_telefoni)C++17
80 / 80
12 ms1020 KiB
#define _USE_MATH_DEFINES 1 #define _EXT_CODECVT_SPECIALIZATIONS_H 1 #define _EXT_ENC_FILEBUF_H 1 #include <bits/stdc++.h> #include <bits/extc++.h> using namespace std; using namespace __gnu_pbds; #define MOD 1000000007ll #define EPS 1e-9 typedef long long ll; typedef long double ld; typedef pair <ll,ll> pl; typedef tuple <ll,ll,ll> tl; ll N, D, L, T; vector <ll> tele; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> N >> D; for (ll i = 1; i <= N; i++) { char state; cin >> state; if (state == '1') tele.push_back(i); } for (ll i = 1; i < (ll)tele.size(); i++) { T += (tele[i] - tele[i-1] - 1) / D; } cout << T; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...