# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
447760 | dxz05 | 코끼리 (Dancing Elephants) (IOI11_elephants) | C++14 | 1 ms | 304 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "elephants.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 3e2;
int N, L;
int X[MAXN];
int perm[MAXN];
void init(int _N, int _L, int _X[]){
N = _N;
L = _L;
for (int i = 0; i < N; i++) {
X[i] = _X[i];
perm[i] = i;
}
sort(perm, perm + N, [](int i, int j){
return X[i] < X[j];
});
}
int update(int i, int y){
X[i] = y;
int j = i;
while (j < N - 1 && X[perm[j]] > X[perm[j + 1]]){
swap(perm[j], perm[j + 1]);
j++;
}
j = i;
while (j > 1 && X[perm[j]] < X[perm[j - 1]]){
swap(perm[j], perm[j - 1]);
j--;
}
for (j = 0; j < N; j++) cerr << X[perm[j]] << ' '; cerr << endl;
int ans = 1, last = X[perm[0]];
for (j = 0; j < N; j++){
int x = X[perm[j]];
if (x - last > L){
ans++;
last = x;
}
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |