답안 #799915

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
799915 2023-08-01T08:19:43 Z Sohsoh84 코끼리 (Dancing Elephants) (IOI11_elephants) C++17
26 / 100
9000 ms 2116 KB
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")

#include "elephants.h"
#include <bits/stdc++.h>

#pragma GCC target("avx2")

using namespace std;

const int MAXN = 50000 + 10;

int X[MAXN], n, L;
set<int> st; // TODO: multiset

void init(int N, int L_, int X_[]) {
	L = L_;
	for (int i = 0; i < N; i++) {
		X[i] = X_[i];	
		st.insert(X[i]);
	}

	n = N;
}

int update(int i, int y) {
	st.erase(X[i]);
	X[i] = y;
	st.insert(X[i]);

	int ans = 0;
	int v = *st.begin();

	while (true) {
		ans++;
		auto it = st.lower_bound(v + L + 1);
		if (it == st.end()) break;
		v = *it;
	}
	
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 312 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 312 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Execution timed out 9037 ms 2116 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 312 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Execution timed out 9037 ms 2116 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 312 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Execution timed out 9037 ms 2116 KB Time limit exceeded
8 Halted 0 ms 0 KB -