제출 #132799

#제출 시각아이디문제언어결과실행 시간메모리
132799redaDetecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#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; }

컴파일 시 표준 에러 (stderr) 메시지

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;
        ^