제출 #1093943

#제출 시각아이디문제언어결과실행 시간메모리
1093943Aviansh코끼리 (Dancing Elephants) (IOI11_elephants)C++17
26 / 100
9032 ms4956 KiB
#include <bits/stdc++.h> #include "elephants.h" using namespace std; int n; int l; int *x; map<int,int>mp; void init(int N, int L, int X[]) { n = N; l=L; x=X; for(int i = 0;i<n;i++){ mp[x[i]]++; } } int update(int i, int y) { mp[x[i]]--; if(mp[x[i]]==0){ mp.erase(x[i]); } x[i]=y; mp[x[i]]++; int ans = 1; int las = (*mp.begin()).first; for(pair<int,int>p:mp){ if(p.first-las>l){ las=p.first; 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...