답안 #151652

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
151652 2019-09-04T03:42:23 Z cos18 King of Chairs (FXCUP4_chairs) C++17
0 / 100
1000 ms 3360 KB
#include "king.h"

long long SendInfo(std::vector<int> W, std::vector<int> C) {
	return 0;
}
#include "vassal.h"
#include <algorithm>

std::vector<int> realC;
int check[100000] = {};
int N;

int find(int target, int start, int end) {
	int location = (start + end) / 2;
	if (target == realC[location]) return location;
	if (start == end) {
		if (target > realC[location]) return location;
		return location - 1;
	}
	if (target > realC[location]) return find(target, location+1, end);
	return find(target, start, location-1);
}

void Init(long long B, std::vector<int> C) {
	realC = C;
	sort(realC.begin(), realC.end());
	N = realC.size();
}

int Maid(int W) {
	int location = find(W, 0, N-1);
	while (location >= 0) {
		if (!check[location]) {
			check[location] = 1;
			break;
		}
		location--;
	}
	return location;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 884 KB Wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1075 ms 3336 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 41 ms 3360 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -