제출 #297822

#제출 시각아이디문제언어결과실행 시간메모리
297822khangalDetecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include "molecules.h" vector<int> find_subset(int l, int u, vector<int> w){ int n = w.size(); vector<pair<int,int>> vp; vp.resize(n); vector<int> ans; for(int i=0;i<n;i++){ vp[i]={w[i],i}; } sort(vp.begin(),vp.end()); ll sum = 0,j = 0; for(int i=0;i<n;i++){ while(j < n && sum < l){ sum += vp[j].first; j++; } if(sum >= l && sum <= u){ for(int o=i;o<j;o++){ ans.push_back(vp[o].second); } return ans; } sum -= vp[i].first; } return vector<int>(); }

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

molecules.cpp:2:1: error: 'vector' does not name a type
    2 | vector<int> find_subset(int l, int u, vector<int> w){
      | ^~~~~~