Submission #86338

#TimeUsernameProblemLanguageResultExecution timeMemory
86338NurstanDuisengalievTelefoni (COCI17_telefoni)C++14
80 / 80
111 ms800 KiB
#include <bits/stdc++.h> #define pb push_back using namespace std; vector <int> x; int main () { int n, m; cin >> n >> m; bool a[n]; for (int i = 0; i < n; i ++) { cin >> a[i]; } int sum = 0; int k = 0; for (int i = 0; i < n; i ++) { if (a[i] == 0) { k ++; } else { if (k != 0) { x.pb(k); } k = 0; } } if (k != 0) { x.pb(k); } for (int i = 0; i < x.size(); i ++) { sum += x[i] /m; } cout << sum; return 0; }

Compilation message (stderr)

telefoni.cpp: In function 'int main()':
telefoni.cpp:28:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < x.size(); i ++) {
                     ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...