답안 #1087833

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1087833 2024-09-13T09:58:23 Z MahmytM Detecting Molecules (IOI16_molecules) C++17
컴파일 오류
0 ms 0 KB
#include "molecules.h"
#include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
vector<int> find_subset(int l, int u, vector<int> w){
    int sum=0;
    vector<int> ans;
    for(int i=0;i<w.size();i++){
    	if(sum+w[i]<=u){
    		sum+=w[i];
    		ans.pb(i);
		}
	}
	if(l<=sum and sum<=u){
		return ans;
	}else{
		ans.clear();
		ans.pb(0);
		return ans;
	}
}

Compilation message

molecules.cpp:9:1: error: 'vector' does not name a type
    9 | vector<int> find_subset(int l, int u, vector<int> w){
      | ^~~~~~