Submission #254742

#TimeUsernameProblemLanguageResultExecution timeMemory
254742SortingDancing Elephants (IOI11_elephants)C++14
26 / 100
9031 ms2816 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; for(int i = 0; i < n; ++i) s.insert(x[i]); } int update(int idx, int y){ s.erase(s.find(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...