제출 #261534

#제출 시각아이디문제언어결과실행 시간메모리
261534test2코끼리 (Dancing Elephants) (IOI11_elephants)C++14
26 / 100
9053 ms4048 KiB
//#include "elephants.h" #include<bits/stdc++.h> #define I inline void using namespace std ; using ld = long double ; using ll = long long ; const int N = 1e6 + 7 , mod = 1e9 + 7 ; int n; int c ; map<int , int > ele ; int pos[N]; void init(int N, int L, int X[]) { n = N; c = L ; for(int i = 0 ;i < N ;i++) ele[ X[i] ] ++ , pos[i] = X[i] ; } int answer(){ int ret = 0 ; int l = -1e9 ; for(auto u : ele){ if(u.second){ if(u.first > l + c){ ret++ ; l = u.first ; } } } return ret ; } int update(int i, int y) { ele[pos[i]]--; pos[i]=y; ele[pos[i]]++; return answer() ; }
#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...