Submission #875826

#TimeUsernameProblemLanguageResultExecution timeMemory
875826BbtTVudu (COCI15_vudu)C++17
42 / 140
1064 ms17704 KiB
#include<bits/stdc++.h> using namespace std; long long int N,P,a[1000001]; int main(){ long long int C=0; cin>>N; for(int i=1;i<=N;i++){ int temp; scanf("%d",&temp); a[i]=a[i-1]+temp; } cin>>P; for(int i=1;i<=N;i++){ for(int j=i;j<=N;j++){ if(a[j]-a[i-1]>=P*(j-i+1))C++; } }cout<<C<<endl; return 0; }

Compilation message (stderr)

vudu.cpp: In function 'int main()':
vudu.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         scanf("%d",&temp);
      |         ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...