Submission #347359

#TimeUsernameProblemLanguageResultExecution timeMemory
347359MefarnisDancing Elephants (IOI11_elephants)C++14
0 / 100
1 ms364 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...