답안 #114534

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
114534 2019-06-01T16:42:32 Z ly20 Detecting Molecules (IOI16_molecules) C
컴파일 오류
0 ms 0 KB
#include "molecules.h"
const int MAXN=11234;
int resp[MAXN],kn[MAXN];
int find_subset(int l,int u,int w[],int n,int result[])
{
	for(int i=0;i<MAXN;i++)
	{
		kn[i]=-1;
	}
	kn[0]=-2;
	for(int i=0;i<n;i++)
	{
		for(int j=MAXN-1;j>=w[i];j--)
		{
			if(kn[j-w[i]]!=-1 && kn[j]==-1)kn[j]=i;
		}
	}
	int val=-1;
	for(int i=l;i<=u;i++)
	{
		if(kn[i]!=-1)val=i;
	}
	if(val==-1)return 0;
	int cont=0;
	while(val>0)
	{
		result[cont]=kn[val];
		val-=w[kn[val]];
		cont++;
	}
	for(int i=0;i<cont;i++)resp[i]=result[i];
	return 0;
}

Compilation message

In file included from molecules.c:1:0:
molecules.h:3:10: fatal error: vector: No such file or directory
 #include <vector>
          ^~~~~~~~
compilation terminated.