답안 #156542

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
156542 2019-10-06T12:01:17 Z a_player Detecting Molecules (IOI16_molecules) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

#define f first
#define s second
#define mp make_pair
#define pb push_back

using namespace std;

typedef long long ll;
int diff[10001];
vector<int> find_subset(int l,int u,vector<int> w){
	int N=w.size();
	sort(w.begin(),w.end());
	for(int i=0;i<N;i++)diff[i]=w[i]-w[0];
	int h=(u-w[0]+w[N-1])/w[N-1];
	int s=h*v[0];
	vector<int> sol;
	for(int i=N-1;i>=N-h+1;i--){
		s+=diff[i];
		sol.push_back(i);
		} 
	for(int i=N-h;i>=0;i--)if(s+diff[i]<=u&&s+diff[i]>=l){
		sol.push_back(i);
		return sol;
		}
	vector<int> err;
  return err;
}

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:17:10: error: 'v' was not declared in this scope
  int s=h*v[0];
          ^