# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90830 | MohamedAhmed0 | Vudu (COCI15_vudu) | C++14 | 1091 ms | 54028 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |