답안 #149535

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
149535 2019-09-01T06:41:19 Z distutpia(#3780, cblimmm, wooks1998) King of Chairs (FXCUP4_chairs) C++17
100 / 100
174 ms 10456 KB
#include "king.h"

long long SendInfo(std::vector<int> W, std::vector<int> C) {
	int N = W.size();
	return 0;
}
#include "vassal.h"
#include<set>
#include<algorithm>
long long BB;
int siz;
std::multiset<std::pair<int, int> > a;
void Init(long long B, std::vector<int> C){
	int N = C.size();
	siz=N;
	for(int i=0; i<N; i++){
		a.insert(std::make_pair(C[i], i));
	}
	// ToDo
}

int Maid(int W){
	std::multiset<std::pair<int, int> >::iterator ite;
	ite=a.upper_bound(std::make_pair(W-1, siz));
	if(ite==a.end()){
			return -1;
	}else{
		std::pair<int, int> now=*ite;
		a.erase(ite);
		return now.second; 
	}
}

Compilation message

king.cpp: In function 'long long int SendInfo(std::vector<int>, std::vector<int>)':
king.cpp:4:6: warning: unused variable 'N' [-Wunused-variable]
  int N = W.size();
      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 1056 KB Correct
2 Correct 10 ms 1056 KB Correct
3 Correct 10 ms 1056 KB Correct
4 Correct 10 ms 1056 KB Correct
5 Correct 10 ms 1056 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 65 ms 5948 KB Correct
2 Correct 109 ms 9644 KB Correct
3 Correct 115 ms 10452 KB Correct
4 Correct 117 ms 10448 KB Correct
5 Correct 113 ms 9920 KB Correct
6 Correct 110 ms 10196 KB Correct
7 Correct 112 ms 10444 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 78 ms 5944 KB Correct
2 Correct 152 ms 9640 KB Correct
3 Correct 131 ms 10292 KB Correct
4 Correct 163 ms 10452 KB Correct
5 Correct 174 ms 10448 KB Correct
6 Correct 159 ms 10456 KB Correct
7 Correct 131 ms 10452 KB Correct
8 Correct 126 ms 10456 KB Correct