Submission #578275

# Submission time Handle Problem Language Result Execution time Memory
578275 2022-06-16T09:59:52 Z Dan4Life Dancing Elephants (IOI11_elephants) C++17
0 / 100
1 ms 468 KB
#include "elephants.h"
#include <bits/stdc++.h>
using namespace std;
int n, pos[70010], l;
multiset<int> S;

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

int update(int i, int y)
{
    S.erase(S.find(pos[i]));
    S.insert(y);
    int cur = *S.begin(), cnt = 1;
    for(auto u : S)
        if(cur+l<u) cur = u, cnt++;
    return cnt;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -