제출 #348884

#제출 시각아이디문제언어결과실행 시간메모리
348884juggernaut코끼리 (Dancing Elephants) (IOI11_elephants)C++14
26 / 100
9037 ms2924 KiB
#include"elephants.h" #include<bits/stdc++.h> using namespace std; int n,pos[150001],l; multiset<int>myset; void init(int N,int L,int X[]){ n=N,l=L; for (int i=0;i<n;i++){ pos[i]=X[i]; myset.insert(X[i]); } } int update(int i,int y){ myset.erase(myset.find(pos[i])); myset.insert(y); int b=-1,ans=0; for(auto it:myset){ if(it<=b)continue; b=it+l,ans++; } pos[i]=y; 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...