제출 #799912

#제출 시각아이디문제언어결과실행 시간메모리
799912Sohsoh84코끼리 (Dancing Elephants) (IOI11_elephants)C++17
26 / 100
9003 ms2516 KiB
// pragmas #include "elephants.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 50000 + 10; int X[MAXN], n, L; set<int> st; // TODO: multiset void init(int N, int L_, int X_[]) { L = L_; for (int i = 0; i < N; i++) { X[i] = X_[i]; st.insert(X[i]); } n = N; } int update(int i, int y) { st.erase(X[i]); X[i] = y; st.insert(X[i]); int ans = 0; int v = *st.begin(); while (true) { ans++; auto it = st.lower_bound(v + L + 1); if (it == st.end()) break; v = *it; } 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...