답안 #106287

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
106287 2019-04-17T19:09:12 Z tincamatei 코끼리 (Dancing Elephants) (IOI11_elephants) C++14
26 / 100
9000 ms 2048 KB
#include "elephants.h"
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 150000;

int N, L;
int v[MAX_N];
int aux[MAX_N];

void init(int _N, int _L, int X[]) {
	N = _N;
	L = _L;

	for(int i = 0; i < N; ++i) {
		v[i] = X[i];
	}
}

int update(int x, int y) {
	int i, j;
	
	v[x] = y;
	for(i = 0; i < N; ++i)
		aux[i] = v[i];
	
	sort(aux, aux + N);

	i = 0;
	
	int rez = 0;
	while(i < N) {
		j = i;
		while(j < N && aux[i] + L >= aux[j])
			++j;

		i = j;
		rez++;
	}

	return rez;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 340 KB Output is correct
7 Execution timed out 9068 ms 2048 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 340 KB Output is correct
7 Execution timed out 9068 ms 2048 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 340 KB Output is correct
7 Execution timed out 9068 ms 2048 KB Time limit exceeded
8 Halted 0 ms 0 KB -