제출 #469888

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

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

molecules.cpp: In function 'std::vector<long long int> find_subset(long long int, long long int, std::vector<long long int>)':
molecules.cpp:5:25: error: 'n' was not declared in this scope
    5 |     for(long long i=0;i<n;++i){
      |                         ^
molecules.cpp:4:15: warning: unused variable 'kiri' [-Wunused-variable]
    4 |     long long kiri=0, sums=0;
      |               ^~~~