Submission #648976

# Submission time Handle Problem Language Result Execution time Memory
648976 2022-10-08T21:22:16 Z tvladm2009 Vudu (COCI15_vudu) C++14
0 / 140
110 ms 25620 KB
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template<class T> using oset = tree<T, null_type, std::less<T>, rb_tree_tag,tree_order_statistics_node_update>;

int const nmax = 1000000;

long long v[5 + nmax], sp[5 + nmax];

signed main() {
  std::ios_base::sync_with_stdio(0);
  std::cin.tie(0);

  long long n, p;
  std::cin >> n;
  for(int i = 1;i <= n; i++)
    std::cin >> v[i];
  std::cin >> p;
  for(int i = 1;i <= n; i++) {
    v[i] -= p;
    sp[i] = sp[i - 1] + v[i];
  }

  //oset<long long> s;
  //s.insert(0);
  long long ans = 0;
  //for(int i = 1;i <= n; i++) {
    // ans += s.order_of_key(sp[i]);
    // s.insert(sp[i]);
  //}
  //std::map<long long, long long> mp;
  //mp[0]++;
  //for(int i = 1;i <= n; i++) {
    //ans += mp.count(sp[i]);
    //mp[sp[i]]++;
  //}
  std::cout << ans;
  return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Incorrect 1 ms 340 KB Output isn't correct
3 Incorrect 1 ms 340 KB Output isn't correct
4 Incorrect 106 ms 24764 KB Output isn't correct
5 Incorrect 56 ms 8760 KB Output isn't correct
6 Incorrect 90 ms 21840 KB Output isn't correct
7 Incorrect 95 ms 22668 KB Output isn't correct
8 Incorrect 76 ms 12368 KB Output isn't correct
9 Incorrect 110 ms 25620 KB Output isn't correct
10 Incorrect 97 ms 22216 KB Output isn't correct