Submission #36355

# Submission time Handle Problem Language Result Execution time Memory
36355 2017-12-08T03:56:20 Z funcsr Dancing Elephants (IOI11_elephants) C++14
26 / 100
9000 ms 25224 KB
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <set>
#include "elephants.h"
using namespace std;
#define INF 1145141919
#define rep(i, n) for (int i=0; i<(n); i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define _1 first
#define _2 second
typedef pair<int, int> P;

int N, L;
int A[150000];
multiset<int> B;

void init(int n, int l, int X[]) {
  N = n, L = l;
  rep(i, N) A[i] = X[i], B.insert(X[i]);
}

int update(int i, int y) {
  B.erase(B.find(A[i]));
  B.insert(A[i] = y);
  int until = *B.begin()+L, c = 1;
  for (int b : B) {
    if (b > until) until = b+L, c++;
  }
  return c;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 18228 KB Output is correct
2 Correct 0 ms 18228 KB Output is correct
3 Correct 0 ms 18228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 18228 KB Output is correct
2 Correct 0 ms 18228 KB Output is correct
3 Correct 0 ms 18228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 9000 ms 18888 KB Execution timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9000 ms 19020 KB Execution timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9000 ms 25224 KB Execution timed out
2 Halted 0 ms 0 KB -