답안 #878896

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
878896 2023-11-25T12:44:26 Z Gray Bomb (IZhO17_bomb) C++17
컴파일 오류
0 ms 0 KB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
#include <cassert>
#include <vector>
#define ll long long
#define ln "\n"
#define ff first
#define ss second
#define ld long double
const ll INF = 2e18;
const ll MOD = 1e9+7;
using namespace std;

vector<ll> find_subset(int s, int e, std::vector<int> w) {
	ll n = w.size();
	vector<pair<ll, ll>> bw(n);
	for (ll i=0; i<n; i++){
		bw[i] = {w[i], i};
	}
	sort(bw.rbegin(), bw.rend());
	ll l=0,r=0,sum=bw[0].ff;
	while (r<n) {
		if (sum<s){
			r++;
			if (r==n) break;
			sum+=bw[r].ff;
		}else{
			if (sum<e){
				vector<ll> ind;
				for (ll i=l; i<=r; i++){
					ind.push_back(bw[i].ss);
				}
				return ind;
			}
			sum-=bw[l].ff;
			l++;
		}
	}
	return vector<ll>(0);
}

Compilation message

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status