제출 #777522

#제출 시각아이디문제언어결과실행 시간메모리
777522JoenPoenManDetecting Molecules (IOI16_molecules)C++17
10 / 100
1 ms340 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> dp; std::vector<int> find_subset(int l, int u, std::vector<int> w) { dp.resize(u+1); for (int i = 0; i < w.size(); i++) { for (int j = dp.size()-1; j > 0; j--) { if (dp[j].size() > 0 && j+w[i] <= u) { dp[j+w[i]] = dp[j]; dp[j+w[i]].push_back(i); if (j+w[i] >= l) return dp[j+w[i]]; } } dp[w[i]] = {i}; } return std::vector<int>(0); }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:10:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |     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...