| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 29111 | Nikefor | 코끼리 (Dancing Elephants) (IOI11_elephants) | C++98 | 9000 ms | 31772 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "elephants.h"
#include<cmath>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
//int n;
bool s1 = false;
int p[3];
int l;
vector<int> vec;
map<int,int> M;
set<int> s;
void init(int N, int L, int X[])
{
if(N==2) s1= true;
p[0] = X[0];
p[1] = X[1];
for(int i=0; i<N; i++) {
M[i] = X[i];
s.insert(X[i]);
}
//n = N;
l = L;
}
int update(int i, int y)
{
if(s1) {
p[i] = y;
if( (p[0]-p[1]) <=l and (p[0]-p[1]) >=-l ) return 1;
return 2;
}
set<int>::iterator it= s.find(M[i]);
s.erase(it);
s.insert(y);
M[i] = y;
int c = 0;
int pos = -1;
for(it = s.begin(); it!= s.end(); it++) {
if(*it> pos+l or pos==-1) {
c++;
pos = *it;
}
}
return c;
//return n;
}
| # | 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... | ||||
