제출 #961208

#제출 시각아이디문제언어결과실행 시간메모리
961208raspyDetecting Molecules (IOI16_molecules)C++14
9 / 100
1 ms600 KiB
#include "molecules.h" #include <iostream> #include <algorithm> using namespace std; vector<int> find_subset(int l, int u, vector<int> w) { sort(w.begin(), w.end()); int lf = 0, rg = 0; long long trs = 0; while (rg <= w.size() && (lf < rg || rg == 0)) { // cout << lf << " " << rg << " " << trs << "\n"; if (trs > u) { trs -= w[lf]; lf++; } else if (trs < l) { trs += w[rg]; rg++; } else { vector<int> rez; for (int i = lf; i < rg; i++) rez.push_back(i); return rez; } } return vector<int>(0); }

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

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