답안 #257107

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
257107 2020-08-03T15:38:08 Z uacoder123 Vudu (COCI15_vudu) C++14
0 / 140
834 ms 65540 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define F first
#define S second
#define FOR(i,a,b) for (auto i = (a); i <= (b); ++i)
#define NFOR(i,a,b) for(auto i = (a); i >= (b); --i)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define mp(i,a) make_pair(i,a)
#define pb(a) push_back(a)
#define bit(x,b) (x&(1LL<<b))
  
typedef long long int lli;
typedef pair <lli,lli> ii;
typedef pair <lli,ii> iii;
typedef vector <lli> vi;
typedef tree<pair<lli,int>,null_type,less<pair<lli,int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
  ordered_set se;
  int arr[1000001];
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout<<sizeof(arr)<<endl;
  int n,k,co=0;
  lli cs=1,ans=0;
  cin>>n;
  for(lli i=0;i<n;++i)
    cin>>arr[i];
  cin>>k;
  for(lli i=0;i<n;++i)
  {
    arr[i]-=k;
    cs+=arr[i];
    se.insert(mp(lli(arr[i]-cs),co));
    ans+=se.size()-se.order_of_key(mp(-cs,0*1LL));
    co++;
  }
  cout<<ans<<endl;
  return(0);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 896 KB Output isn't correct
2 Incorrect 4 ms 768 KB Output isn't correct
3 Incorrect 3 ms 768 KB Output isn't correct
4 Incorrect 834 ms 65536 KB Output isn't correct
5 Incorrect 372 ms 37424 KB Output isn't correct
6 Incorrect 616 ms 58488 KB Output isn't correct
7 Incorrect 590 ms 60576 KB Output isn't correct
8 Incorrect 536 ms 52600 KB Output isn't correct
9 Runtime error 631 ms 65540 KB Execution killed with signal 9 (could be triggered by violating memory limits)
10 Incorrect 596 ms 59128 KB Output isn't correct