이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "elephants.h"
#include <bits/stdc++.h>
using namespace std;
const int Nmax = 1e5 + 5;
int n, L, where[Nmax];
multiset<int> S;
void init(int N, int _L, int X[])
{
int i; n = N; L = _L;
for(i=0; i<n; ++i)
{
where[i] = X[i];
S.insert(X[i]);
}
}
int update(int id, int y)
{
S.erase(S.find(where[id]));
S.insert(y); where[id] = y;
int ans = 0;
multiset<int> :: iterator it = S.begin();
while(it != S.end())
{
it = S.upper_bound(*it + L);
++ans;
}
return ans;
}
| # | 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... |