Submission #967735

#TimeUsernameProblemLanguageResultExecution timeMemory
967735vjudge1Vudu (COCI15_vudu)C++17
42 / 140
1100 ms13172 KiB
#include<bits/stdc++.h> #define int long long using namespace std; int n,k,arr[1000100], ans; signed main(){ cin.tie(nullptr)->sync_with_stdio(false); cin >> n; for(int i = 1; i<=n; ++i) cin >> arr[i]; cin >> k; for(int i = 1; i<=n; ++i){ int sum = 0; for(int j = i; j<=n; ++j){ sum+=arr[j]; if(sum >= k*(j - i + 1)) ans++; } } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...