Submission #183150

# Submission time Handle Problem Language Result Execution time Memory
183150 2020-01-10T05:29:17 Z tri Dancing Elephants (IOI11_elephants) C++14
26 / 100
9000 ms 2680 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;

#define pb push_back
#define f first
#define s second

const int MAXN = 1.5e5 + 100;

int pos[MAXN];
multiset<int> pts;

int L;

void init(int N, int iL, int X[]) {
    L = iL;
    for (int i = 0; i < N; i++) {
        pos[i] = X[i];
        pts.insert(X[i]);
    }
}

int update(int i, int y) {
    pts.erase(pos[i]);
    pos[i] = y;
    pts.insert(y);

    int cnt = 0;

    auto it = pts.begin();

    while (it != pts.end()) {
        it = pts.upper_bound((*it) + L);
        cnt++;
    }
    return cnt;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 2 ms 380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 2 ms 380 KB Output is correct
4 Correct 2 ms 396 KB Output is correct
5 Correct 0 ms 376 KB Output is correct
6 Correct 2 ms 380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 2 ms 380 KB Output is correct
4 Correct 2 ms 396 KB Output is correct
5 Correct 0 ms 376 KB Output is correct
6 Correct 2 ms 380 KB Output is correct
7 Execution timed out 9068 ms 2680 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 2 ms 380 KB Output is correct
4 Correct 2 ms 396 KB Output is correct
5 Correct 0 ms 376 KB Output is correct
6 Correct 2 ms 380 KB Output is correct
7 Execution timed out 9068 ms 2680 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 2 ms 380 KB Output is correct
4 Correct 2 ms 396 KB Output is correct
5 Correct 0 ms 376 KB Output is correct
6 Correct 2 ms 380 KB Output is correct
7 Execution timed out 9068 ms 2680 KB Time limit exceeded
8 Halted 0 ms 0 KB -