답안 #946610

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
946610 2024-03-14T19:44:51 Z StefanSebez 코끼리 (Dancing Elephants) (IOI11_elephants) C++14
26 / 100
9000 ms 9624 KB
#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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 8540 KB Output is correct
2 Correct 1 ms 8540 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 8540 KB Output is correct
2 Correct 1 ms 8540 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8540 KB Output is correct
5 Correct 1 ms 8540 KB Output is correct
6 Correct 1 ms 8540 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 8540 KB Output is correct
2 Correct 1 ms 8540 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8540 KB Output is correct
5 Correct 1 ms 8540 KB Output is correct
6 Correct 1 ms 8540 KB Output is correct
7 Correct 7855 ms 9624 KB Output is correct
8 Execution timed out 9084 ms 9564 KB Time limit exceeded
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 8540 KB Output is correct
2 Correct 1 ms 8540 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8540 KB Output is correct
5 Correct 1 ms 8540 KB Output is correct
6 Correct 1 ms 8540 KB Output is correct
7 Correct 7855 ms 9624 KB Output is correct
8 Execution timed out 9084 ms 9564 KB Time limit exceeded
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 8540 KB Output is correct
2 Correct 1 ms 8540 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8540 KB Output is correct
5 Correct 1 ms 8540 KB Output is correct
6 Correct 1 ms 8540 KB Output is correct
7 Correct 7855 ms 9624 KB Output is correct
8 Execution timed out 9084 ms 9564 KB Time limit exceeded
9 Halted 0 ms 0 KB -