Submission #620070

#TimeUsernameProblemLanguageResultExecution timeMemory
620070sword060Vudu (COCI15_vudu)C++17
126 / 140
594 ms65536 KiB
#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<long long, null_type,less_equal<long long>, rb_tree_tag,tree_order_statistics_node_update> ordered_set s; int x,k,a[1000005]; int main(){ ios::sync_with_stdio(0);cin.tie(0); cin>>x; long long ans=0; for(int i=0;i<x;i++)cin>>a[i]; cin>>k; s.insert(0); long long xd=0; for(int i=0;i<x;i++){ xd+=a[i]-k; ans+=s.order_of_key(xd+1); s.insert(xd); } cout<<ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...