Submission #681012

#TimeUsernameProblemLanguageResultExecution timeMemory
681012sudheerays123Vudu (COCI15_vudu)C++17
42 / 140
1083 ms16288 KiB
#include<bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define ll long long int #define ld long double const ll N = 100+5 , INF = 1e18 , MOD = 1e9+7; void solve(){ ll n; cin >> n; vector<ll> a(n+5) , sum(n+5); for(ll i = 1; i <= n; i++){ cin >> a[i]; sum[i] = sum[i-1]+a[i]; } ll p; cin >> p; ll ans = 0; for(ll j = 1; j <= n; j++){ for(ll i = 1; i <= j; i++){ if(sum[j]-p*j >= sum[i-1]-p*(i-1)) ans++; } } cout << ans; } int main(){ fast; ll tc = 1; // cin >> tc; while(tc--) solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...