This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "elephants.h"
#define maxn 100
using namespace std;
int n,k;
int ar[maxn];
void init(int N, int K, int x[]) {
n = N;
k = K;
for( int i = 0 ; i < n ; i++ )
ar[i] = x[i];
}
int update(int i, int y) {
ar[i] = y;
sort(ar,ar+n);
int ans = 0;
int last = INT_MIN;
for( int i = 0 ; i < n ; i++ )
if(ar[i] > last+k)
ans++ , last = ar[i];
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... |