제출 #469896

#제출 시각아이디문제언어결과실행 시간메모리
469896IvnFDetecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include "molecules.h" std::vector<int> find_subset(int l, int u, std::vector<int> w) { long long n=w.size(), kiri=0, sums=0, i=0; std::vector<long long>ans; for(;i<n;++i){ sums+=w[i]; while(sums > u) sums-=w[kiri++]; if(sums>=l && sums<=u){ for(long long j=kiri;j<=i;++j) ans.push_back(j); return ans; } } return ans; }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:11:20: error: could not convert 'ans' from 'vector<long long int>' to 'vector<int>'
   11 |             return ans;
      |                    ^~~
      |                    |
      |                    vector<long long int>
molecules.cpp:14:12: error: could not convert 'ans' from 'vector<long long int>' to 'vector<int>'
   14 |     return ans;
      |            ^~~
      |            |
      |            vector<long long int>