# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
620067 | sword060 | Vudu (COCI15_vudu) | C++17 | 1064 ms | 55560 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;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
ordered_set s;
int main(){
ios::sync_with_stdio(0);cin.tie(0);
long long x,k;cin>>x;
long long a[x+3],ans=0;
for(int i=0;i<x;i++)cin>>a[i];
cin>>k;
for(int i=0;i<x;i++)a[i]-=k;
s.insert(0);
long long xd=0;
for(int i=0;i<x;i++){
xd+=a[i];
ans+=s.order_of_key(xd+1);
s.insert(xd);
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |