제출 #29061

#제출 시각아이디문제언어결과실행 시간메모리
29061inqr코끼리 (Dancing Elephants) (IOI11_elephants)C++14
26 / 100
9000 ms25228 KiB
#include "elephants.h" #include <bits/stdc++.h> using namespace std; int n,l,up; int elepos[150005]; multiset < int > line; void init(int N, int L, int X[]) { n = N; l = L; for(int i=0;i<N;i++){ elepos[i]=X[i]; line.insert(X[i]); } line.insert(INT_MAX); } int shoot(){ int camnum=0; int covered=*line.begin(); multiset<int>::iterator it=line.begin(); while(*it!=INT_MAX){ //printf("%d DB camnum=%d covered=%d it=%d \n",up,camnum,covered,*it); camnum++; covered+=l; it=line.upper_bound(covered); covered=*it; //printf("%d DB camnum=%d covered=%d it=%d \n",up,camnum,covered,*it); } return camnum; } int update(int i, int y) { line.erase(line.find(elepos[i])); elepos[i]=y; line.insert(elepos[i]); up++; return shoot(); }
#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...