Submission #392935

#TimeUsernameProblemLanguageResultExecution timeMemory
392935HazemDancing Elephants (IOI11_elephants)C++14
26 / 100
9027 ms3300 KiB
#include "elephants.h" #include <bits/stdc++.h> using namespace std; const int N1 = 2e5+10; int n,l; set<int>st; int val[N1]; void init(int N, int L, int X[]) { n = N,l = L; for(int i=0;i<n;i++) st.insert(X[i]),val[i] = X[i]; } int update(int i, int y) { st.erase(st.find(val[i])); st.insert(y); val[i] = y; vector<int>vec; for(auto x:st) vec.push_back(x); int ret = 0,cur = -1; for(auto x:vec) if(x>cur)ret++,cur = x+l; return ret; }
#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...