Submission #968352

#TimeUsernameProblemLanguageResultExecution timeMemory
968352vjudge1Vudu (COCI15_vudu)C++17
42 / 140
1059 ms17748 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long long long qs[1000001]; int main() { cin.tie(0)->sync_with_stdio(false); cout.tie(0); int n; cin >> n; for (int i = 1;i <= n;i++) { cin >> qs[i]; qs[i]+=qs[i-1]; } int p; cin >> p; ll cnt=0; for (int i=1;i<=n;i++) { for (int j=i;j<=n;j++) { if ((qs[j]-qs[i-1])/(j-i+1) >= p) { cnt++; } } } cout << cnt; }
#Verdict Execution timeMemoryGrader output
Fetching results...