답안 #133358

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
133358 2019-07-20T12:34:18 Z rajarshi_basu Detecting Molecules (IOI16_molecules) C++14
컴파일 오류
0 ms 0 KB
#include <iostream>
#include <vector>
#include <set>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <unordered_map>
#include <fstream>
#include <complex>
#include <random>
#include <stack>
#include <chrono>
#include <set>

#include "molecules.h"
 
#define FOR(i,n) for(int i=0;i<n;i++)
#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define ll long long int
#define vi vector<ll>
#define ii pair<int,int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pll pair<ll,ll>
#define cd complex<double> 
#define ld long double
#define pld pair<ld,ld>
#define iii pair<ii,int>
#define vv vector
 
using namespace std;

const int MAXN = 500000 + 10;

vi find_subset(int l,int u,vi w){
	int n = w.size();
	int lptr = 0;
	vv<ii> ids;
	FOR(i,n)ids.pb({w[i],i});
	sort(ids.begin(), ids.end());
	ll sum = 0;
	FOR(i,n){
		sum += ids[i].ff;
		if(l <= sum and sum <= u){
			vi t;
			FORE(j,lptr,i){
				t.pb(ids[j].ss);
			}
			sort(t.begin(), t.end());
			return t;
		}
		while(sum > u){
			sum -= ids[lptr++].ff;
			if(lptr > i)break;
		}
	}
	vi x;
	return x;
}

Compilation message

/tmp/cc6SpouD.o: In function `main':
grader.cpp:(.text.startup+0x152): undefined reference to `find_subset(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status