답안 #132799

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
132799 2019-07-19T15:04:08 Z reda Detecting Molecules (IOI16_molecules) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std ;
 vector<int>find_subset(int l, int r, vector<int> w)
{
    vector<int> ans;
    int c=0;
for(int i=0;i<w.size();i++)
{
    if(c+w[i]<=r && c+w[i]>=l)
    {
    c+=w[i];
    ans.push_back(w[i]);
    }
    else break; 
}
return ans;
return 0;
}

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:7:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 for(int i=0;i<w.size();i++)
             ~^~~~~~~~~
molecules.cpp:17:8: error: could not convert '0' from 'int' to 'std::vector<int>'
 return 0;
        ^