제출 #946610

#제출 시각아이디문제언어결과실행 시간메모리
946610StefanSebez코끼리 (Dancing Elephants) (IOI11_elephants)C++14
26 / 100
9084 ms9624 KiB
#include "elephants.h" #include<bits/stdc++.h> using namespace std; const int N=150050; int n,a[N],L; void init(int N1, int L1, int X[]) { n = N1; for(int i=1;i<=n;i++){ a[i]=X[i-1]; } L=L1; } int update(int qind, int y) { qind++;a[qind]=y; int b[n+10]; for(int i=1;i<=n;i++) b[i]=a[i]; sort(b+1,b+n+1); int res=0; for(int i=1;i<=n;){ int j=i; res++; while(j<=n && b[j]-b[i]<=L) j++; i=j; } return res; }
#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...