#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;
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
724 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
596 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
596 KB |
Output isn't correct |
4 |
Incorrect |
644 ms |
65536 KB |
Output isn't correct |
5 |
Incorrect |
299 ms |
41868 KB |
Output isn't correct |
6 |
Correct |
536 ms |
64188 KB |
Output is correct |
7 |
Incorrect |
500 ms |
65536 KB |
Output isn't correct |
8 |
Incorrect |
453 ms |
58660 KB |
Output isn't correct |
9 |
Runtime error |
488 ms |
65536 KB |
Execution killed with signal 9 |
10 |
Incorrect |
489 ms |
64944 KB |
Output isn't correct |