Submission #254738

#TimeUsernameProblemLanguageResultExecution timeMemory
254738SortingDancing Elephants (IOI11_elephants)C++14
0 / 100
0 ms384 KiB
#include "elephants.h" #include <bits/stdc++.h> using namespace std; const int k_N = 15e4 + 3; int n, l; int *x; multiset<int> s; void init(int N, int L, int X[]){ n = N; l = L; x = X; } int update(int idx, int y){ s.erase(x[idx]); x[idx] = y; s.insert(x[idx]); int start = *s.begin(), ans = 1; for(int u: s){ if(u - start > l){ start = u; ans++; } } 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...