제출 #344975

#제출 시각아이디문제언어결과실행 시간메모리
344975antontsiorvasDetecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms364 KiB
#include <algorithm>
#include <vector>
#include "molecules.h"
using namespace std;

std::vector<int> find_subset(int l, int u, std::vector<int> w) {
	std::vector<int> ret, ret2;
	std::sort(w.begin(),w.end());
	if(u < w[0]) return ret;
	int hi=w.size()-1;
	while(l > 0 && u > 0 && hi >= 0){
		if(u-w[hi] >= 0){
			ret.push_back(w[hi]);
			l -= w[hi];
			u -= w[hi];
		}
		hi--;
	}
    if(l <= 0 && u >= 0) return ret;
    return ret2;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…