제출 #807703

#제출 시각아이디문제언어결과실행 시간메모리
807703DeepessonDetecting Molecules (IOI16_molecules)C++17
19 / 100
1 ms212 KiB
#include <bits/stdc++.h> #include "molecules.h" typedef std::pair<int,int> pii; std::vector<int> find_subset(int l, int u, std::vector<int> w) { std::vector<pii> array; for(int i=0;i!=w.size();++i){ array.push_back({w[i],i}); } int N = w.size(); long long la=0,ra=0; long long soma=0; while(la!=N){ while(soma<l&&ra!=N){ soma+=array[ra].first; ++ra; } if(soma<=u&&soma>=l){ std::vector<int> ans; for(int i=la;i!=ra;++i){ ans.push_back(array[i].second); } std::sort(ans.begin(),ans.end()); return ans; } soma-=array[la].first; ++la; } return std::vector<int>(0); }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:6:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |     for(int i=0;i!=w.size();++i){
      |                 ~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...