제출 #382393

#제출 시각아이디문제언어결과실행 시간메모리
382393TrunktyDetecting Molecules (IOI16_molecules)C++14
9 / 100
2 ms364 KiB
#include <iostream> #include <algorithm> #include <vector> using namespace std; int sum=0; vector<int> find_subset(int l, int u, vector<int> w){ sort(w.begin(),w.end()); int lef=0,rit=-1; while(rit!=w.size()-1){ rit++; sum += w[rit]; while(sum>u){ sum -= w[lef]; lef++; } if(sum<=u and sum>=l){ vector<int> a = {}; for(int i=lef;i<=rit;i++){ a.push_back(i); } return a; } } return {}; }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:10:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  while(rit!=w.size()-1){
      |        ~~~^~~~~~~~~~~~
#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...