Submission #850478

# Submission time Handle Problem Language Result Execution time Memory
850478 2023-09-16T15:49:10 Z HunterXD Dancing Elephants (IOI11_elephants) C++17
26 / 100
9000 ms 9308 KB
#include "elephants.h"

#include <set>

using namespace std;

int n, l;
int a[50010];
set<int> ms;

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

int update(int i, int y) {
  ms.erase(a[i]), a[i] = y, ms.insert(y);
  int sig = *ms.begin() + l, counter = 1;
  for (auto v : ms)
    if (v > sig) counter++, sig = v + l;
  return counter;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6492 KB Output is correct
4 Correct 1 ms 6492 KB Output is correct
5 Correct 1 ms 6492 KB Output is correct
6 Correct 1 ms 6492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6492 KB Output is correct
4 Correct 1 ms 6492 KB Output is correct
5 Correct 1 ms 6492 KB Output is correct
6 Correct 1 ms 6492 KB Output is correct
7 Correct 4051 ms 7380 KB Output is correct
8 Correct 6176 ms 7648 KB Output is correct
9 Execution timed out 9056 ms 9308 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6492 KB Output is correct
4 Correct 1 ms 6492 KB Output is correct
5 Correct 1 ms 6492 KB Output is correct
6 Correct 1 ms 6492 KB Output is correct
7 Correct 4051 ms 7380 KB Output is correct
8 Correct 6176 ms 7648 KB Output is correct
9 Execution timed out 9056 ms 9308 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6492 KB Output is correct
4 Correct 1 ms 6492 KB Output is correct
5 Correct 1 ms 6492 KB Output is correct
6 Correct 1 ms 6492 KB Output is correct
7 Correct 4051 ms 7380 KB Output is correct
8 Correct 6176 ms 7648 KB Output is correct
9 Execution timed out 9056 ms 9308 KB Time limit exceeded
10 Halted 0 ms 0 KB -