이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "elephants.h"
#include<bits/stdc++.h>
using namespace std;
const int TAILLEMAXI=102;
int pos[TAILLEMAXI];
int nbelephants,camera,rep,avant;
vector<int> ec;
void init(int N, int L, int depart[]){
nbelephants=N;
for (int i=0;i<nbelephants;i++){
pos[i]=depart[i];
}
camera=L;
}
int update(int indice, int nouv){
pos[indice]=nouv;
ec.clear();
for (int i=0;i<nbelephants;i++){
ec.push_back(pos[i]);
}
sort(ec.begin(),ec.end());
rep=0;
avant=-(1000*1000*1000+2);
for (int i=0;i<nbelephants;i++){
if (avant<ec[i]-camera){
avant=ec[i];
rep++;
}
}
return rep;
}
| # | 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... |