답안 #233837

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
233837 2020-05-21T21:44:26 Z jam_xd_ Detecting Molecules (IOI16_molecules) C++17
컴파일 오류
0 ms 0 KB
#include "molecules.h"
#include "bits/stdc++.h"

using namespace std;

vector<int> find_subset(int l, int u, vector<int> w) {

int gg = w[0], funcionaaa = w.size(), sum = gg;
bool afirmo;

vector<int>covid;
vector<pair<int,int> >nada;

for (int i=0;i<funcionaaa;i++){
        nada.push_back(pair<int,int>(w[i], i));
    }
  //  sort(nada.begin(), nada.end());



for(int i=0;i<funcionaaa;i++){
	if(sum + nada[i].first <= u{
		sum = sum + nada[i].first;
		covid.push_back(nada[i].second);
	}
	if(sum >= l{
		return covid;//nada
	}
}
return covid;
}
//:v  ??
//wEy Ya :"v aiuda xd   SOLO QUIERO 9 PUNTOS >:V

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:22:29: error: expected ')' before '{' token
  if(sum + nada[i].first <= u{
                             ^
molecules.cpp:29:1: error: expected primary-expression before '}' token
 }
 ^
molecules.cpp:9:6: warning: unused variable 'afirmo' [-Wunused-variable]
 bool afirmo;
      ^~~~~~