Submission #850214

#TimeUsernameProblemLanguageResultExecution timeMemory
850214HunterXDDancing Elephants (IOI11_elephants)C++17
26 / 100
9060 ms12516 KiB
#include "elephants.h" #include <bits/stdc++.h> using namespace std; int n, l; int a[200000]; multiset<int> ms; void init(int N, int L, int X[]) { n = N, l = L; for (int i = 0; i < n; i++) a[i] = X[i], ms.insert(X[i]); } int update(int i, int y) { ms.erase(ms.find(a[i])), a[i] = y, ms.insert(y); int last = *ms.begin(), counter = 0; for (auto v : ms) { if (v - last > l) counter++, last = v; } counter++; return counter; }
#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...