답안 #347365

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
347365 2021-01-12T16:06:58 Z Mefarnis 코끼리 (Dancing Elephants) (IOI11_elephants) C++14
26 / 100
30 ms 1900 KB
#include <bits/stdc++.h>
#include "elephants.h"
#define maxn 100
using namespace std;

int n,k;
int ar[maxn];
int arr[maxn];

void init(int N, int K, int x[]) {
	n = N;
	k = K;
	for( int i = 0 ; i < n ; i++ )
		ar[i] = x[i];
}

int update(int i, int y) {
	ar[i] = y;
	for( int i = 0 ; i < n ; i++ )
		arr[i] = ar[i];
	sort(arr,arr+n);
	int ans = 0;
	int last = INT_MIN;
	for( int i = 0 ; i < n ; i++ )
		if(arr[i] > last+k)
			ans++ , last = arr[i];
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Incorrect 30 ms 1900 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Incorrect 30 ms 1900 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Incorrect 30 ms 1900 KB Output isn't correct
8 Halted 0 ms 0 KB -