Submission #959182

#TimeUsernameProblemLanguageResultExecution timeMemory
959182AriadnaVudu (COCI15_vudu)C++14
42 / 140
1084 ms13940 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { int n; ll p; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i) cin >> a[i]; cin >> p; ll sum, ans = 0; for (int i = 0; i < n; ++i) { sum = 0; for (int j = i; j < n; ++j) { sum += a[j]; if (sum >= p * (ll)(j-i+1)) ++ans; } } cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...