Submission #87386

#TimeUsernameProblemLanguageResultExecution timeMemory
87386MohamedAhmed0Vudu (COCI15_vudu)C++14
42 / 140
1078 ms64812 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n ; cin>>n ; long long arr[n] ; for(int i = 0 ; i < n ; ++i) cin>>arr[i] ; long long p ; cin>>p ; long long ans = 0 ; for(int i = 0 ; i < n ; ++i) { long long sum = 0 ; for(int j = i ; j < n ; ++j) { sum += arr[j] ; ans += (sum / (j-i+1) >= p) ; } } return cout<<ans , 0 ; }
#Verdict Execution timeMemoryGrader output
Fetching results...