Submission #90830

#TimeUsernameProblemLanguageResultExecution timeMemory
90830MohamedAhmed0Vudu (COCI15_vudu)C++14
42 / 140
1091 ms54028 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 , sum = 0; vector<int>v ; v.push_back(sum); for(int i = 0 ; i < n ; ++i) { sum += (arr[i] - p) ; for(int j = 0 ; j < v.size() ; ++j) { if(v[j] <= sum) ans++; } v.push_back(sum); } return cout<<ans , 0 ; }

Compilation message (stderr)

vudu.cpp: In function 'int main()':
vudu.cpp:20:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j = 0 ; j < v.size() ; ++j)
                         ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...