| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 345741 | daniel920712 | 코끼리 (Dancing Elephants) (IOI11_elephants) | C++14 | 9010 ms | 1760 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "elephants.h"
#include <set>
#include <algorithm>
using namespace std;
int n;
int Next[50005];
int last[50005];
int cha[50005];
int where[50005];
int l;
void init(int N, int l, int X[])
{
int i;
n = N;
::l=l;
for(i=1;i<=N;i++) where[i]=X[i-1];
for(i=0;i<=N;i++) Next[i]=i+1;
for(i=0;i<=N;i++) last[i]=i-1;
where[N+1]=2e9;
}
int update(int i, int y)
{
int now=0,a,b,here,ll;
i++;
a=last[i];
b=Next[i];
Next[a]=b;
last[b]=a;
here=0;
while(1)
{
if(where[Next[here]]>y)
{
a=here;
b=Next[here];
Next[a]=i;
Next[i]=b;
last[b]=i;
last[i]=a;
break;
}
here=Next[here];
}
where[i]=y;
here=Next[0];
ll=where[here];
now=1;
while(here!=n+1)
{
if(where[here]-ll>l)
{
now++;
ll=where[here];
}
here=Next[here];
}
return now;
}
| # | 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... | ||||
