| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1331260 | Mamikonm1 | 코끼리 (Dancing Elephants) (IOI11_elephants) | C++17 | 0 ms | 0 KiB |
#include "elephants.h"
#include<bits/stdc++.h>
using namespace std;
int n,l;
vector<int>x,Y;
void init(int N, int L, vector<int>X)
{
n = N;
l=L;
for(int i=0;i<n;++i)Y.push_back(X[i]);
}
int update(int i, int y)
{
Y[i]=y;
x=Y;
sort(begin(x),end(x));
int ans=0,lf=-(l*2);
for(int i=0;i<n;++i){
if(x[i]-lf>l){
lf=x[i];
ans++;
}
}
return ans;
}