Submission #623616

#TimeUsernameProblemLanguageResultExecution timeMemory
623616lorenzoferrariDancing Elephants (IOI11_elephants)C++17
26 / 100
9006 ms2396 KiB
#include "elephants.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 150000; int n, l, x[MAXN]; multiset<int> s; void init(int nn, int ll, int xx[]) { n = nn, l = ll; for (int i = 0; i < n; ++i) { x[i] = xx[i]; s.insert(x[i]); } } int update(int i, int y) { s.erase(s.find(x[i])); x[i] = y; s.insert(x[i]);; int ans = 0; auto it = s.begin(); while (it != s.end()) { it = s.upper_bound(*it + l); ++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...