답안 #248587

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
248587 2020-07-12T19:38:48 Z davi_bart 코끼리 (Dancing Elephants) (IOI11_elephants) C++14
26 / 100
9000 ms 2560 KB
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include "elephants.h"
using namespace std;
typedef long long ll;
//#define int ll
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n;
vector<int> v(200010);
set<int> k;
int dim;
void init(int N, int L, int X[]){
  n=N;
  for(int i=0;i<N;i++){
      v[i]=X[i];
      k.insert(X[i]);
  }
  dim=L;
}

int update(int i,int y){
  k.erase(v[i]);
  v[i]=y;
  k.insert(v[i]);
  int tot=1;
  int pos=*k.begin();
  for(int x:k){
    if(x-pos<=dim)continue;
    tot++;
    pos=x;
  }
  return tot;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1152 KB Output is correct
2 Correct 1 ms 1152 KB Output is correct
3 Correct 1 ms 1152 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1152 KB Output is correct
2 Correct 1 ms 1152 KB Output is correct
3 Correct 1 ms 1152 KB Output is correct
4 Correct 1 ms 1152 KB Output is correct
5 Correct 1 ms 1152 KB Output is correct
6 Correct 1 ms 1152 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1152 KB Output is correct
2 Correct 1 ms 1152 KB Output is correct
3 Correct 1 ms 1152 KB Output is correct
4 Correct 1 ms 1152 KB Output is correct
5 Correct 1 ms 1152 KB Output is correct
6 Correct 1 ms 1152 KB Output is correct
7 Correct 6836 ms 2404 KB Output is correct
8 Execution timed out 9014 ms 2560 KB Time limit exceeded
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1152 KB Output is correct
2 Correct 1 ms 1152 KB Output is correct
3 Correct 1 ms 1152 KB Output is correct
4 Correct 1 ms 1152 KB Output is correct
5 Correct 1 ms 1152 KB Output is correct
6 Correct 1 ms 1152 KB Output is correct
7 Correct 6836 ms 2404 KB Output is correct
8 Execution timed out 9014 ms 2560 KB Time limit exceeded
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1152 KB Output is correct
2 Correct 1 ms 1152 KB Output is correct
3 Correct 1 ms 1152 KB Output is correct
4 Correct 1 ms 1152 KB Output is correct
5 Correct 1 ms 1152 KB Output is correct
6 Correct 1 ms 1152 KB Output is correct
7 Correct 6836 ms 2404 KB Output is correct
8 Execution timed out 9014 ms 2560 KB Time limit exceeded
9 Halted 0 ms 0 KB -