This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 150010;
int n , l;
int x[maxn];
int a[maxn];
void init(int N , int L , int X[]){
n = N , l = L;
for(int i = 0 ; i < n ; i ++)
x[i] = X[i];
}
int update(int p , int v){
x[p] = v;
for(int i = 0 ; i < n ; i ++)a[i] = x[i];
sort(a , a + n);
int ans = 1;
int L = a[0];
for(int i = 1 ; i < n ; i ++)
if(a[i] - L > l)
L = a[i] , ans ++;
return(ans);
}
Compilation message (stderr)
elephants.cpp:1: warning: ignoring #pragma comment [-Wunknown-pragmas]
1 | #pragma comment(linker, "/stack:200000000")
|
# | 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... |