Submission #850474

#TimeUsernameProblemLanguageResultExecution timeMemory
850474HunterXDDancing Elephants (IOI11_elephants)C++17
26 / 100
9008 ms10584 KiB
#include "elephants.h" using namespace std; #include <set> int n, l; int a[50010]; set<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 sig = *ms.begin() + l, counter = 0; for (auto v : ms) { if (v > sig) counter++, sig = v + l; } return counter + 1; }
#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...