#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <algorithm>
#include <math.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ifstream in("input.txt");
ofstream out("output.txt");
typedef long long ll;
int n;
int ls,rs;
int v[100001];
int res[100001];
pair<int,int> p[100001];
int find_subset(int l, int u, vector<int> w, int n, vector<int> result){
int s=-1;
int d=n-1;
int sum=0;
bool flag=0;
for(int i=0;i<n;i++){
p[i].fi=w[i];
p[i].se=i;
}
sort(p,p+n);
while(s<n){
if(sum>u)break;
while((sum<l||sum>u)&&d>s){
sum+=p[d].fi;
d--;
}
d++;
if(sum>=l&&sum<=u){
flag=1;
break;
}
sum-=p[d].fi;
s++;
sum+=p[s].fi;
}
if(flag){
for(int i=0;i<=s;i++)result.pb(p[i].se);
for(int i=n-1;i>=d;i--)result.pb(p[i].se);
return s+1+n-d;
}
return 0;
}
Compilation message
molecules.c:1:10: fatal error: iostream: No such file or directory
#include <iostream>
^~~~~~~~~~
compilation terminated.