| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1241033 | adriines06 | 코끼리 (Dancing Elephants) (IOI11_elephants) | C++20 | 0 ms | 320 KiB |
#include "elephants.h"
#include<bits/stdc++.h>
using namespace std;
int n,l;
vector<int>v;
void init(int N, int L, int X[])
{
n = N,l=L;
v.resize(n);
for(int i=0;i<n;i++){
v[i]=X[i];
}
}
int update(int i, int y)
{
if(n==1) return 1;
v[i]=y;
sort(v.begin(),v.end());
int xf=v[n-1],pos=v[0],cont=0;
while(pos<=xf){
int s=pos+l+1;
auto it=lower_bound(v.begin(),v.end(),s);
if(it==v.end()){
pos=xf+1;
}
else{
pos=*it;
}
cont++;
//cout<<pos<<"\n";
}
return cont;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
