Submission #269130

#TimeUsernameProblemLanguageResultExecution timeMemory
269130PlurmDancing Elephants (IOI11_elephants)C++11
26 / 100
9009 ms3064 KiB
#include "elephants.h" #include <bits/stdc++.h> using namespace std; int n, l; vector<int> s; int pos[150005]; void init(int N, int L, int X[]) { n = N; l = L; for(int i = 0; i < N; i++){ s.push_back(X[i]); pos[i] = X[i]; } } int update(int i, int y) { s.erase(lower_bound(s.begin(), s.end(), pos[i])); pos[i] = y; s.insert(lower_bound(s.begin(), s.end(), pos[i]), pos[i]); int last = -1; int c = 0; for(int x : s){ if(last < x){ last = x+l; c++; } } return c; }
#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...