Submission #119995

#TimeUsernameProblemLanguageResultExecution timeMemory
119995Osama_AlkhodairyDancing Elephants (IOI11_elephants)C++17
26 / 100
9073 ms2944 KiB
#include <bits/stdc++.h> #include "elephants.h" //~ #include "grader.cpp" using namespace std; int n, l; vector <int> a; set <int> s; void init(int N, int L, int X[]){ n = N; l = L; for(int i = 0 ; i < n ; i++){ a.push_back(X[i]); s.insert(X[i]); } } int update(int i, int y){ s.erase(a[i]); a[i] = y; s.insert(a[i]); int cur = *s.begin(); int ans = 1; for(auto &i : s){ if(cur + l < i){ cur = i; 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...