이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "elephants.h"
#include <bits/stdc++.h>
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define forr(i,A,B) for(int i=A;i<B;++i)
#define space ' '
#define endl '\n'
#define LL long long
using namespace std;
int n,l;
pair<int,int> a[100005];
void init(int N, int L, int X[]){
l=L;
n = N;
forr(i,0,N){
a[i].st=X[i];
a[i].nd=i;
}
}
int update(int i, int y){
int ans=1;
a[a[i].nd].st=y;
sort(a,a+n);
int lp=0,rp=0;
while(rp<n){
if(a[rp].st-a[lp].st<=l){
rp++;
}
else{
ans++;
lp=rp;
++rp;
}
}
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... |