제출 #866681

#제출 시각아이디문제언어결과실행 시간메모리
866681maks007Detecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms348 KiB
#include "molecules.h" #include "bits/stdc++.h" //#include "grader.cpp" using namespace std; vector<int> find_subset(int l, int r, vector<int> a) { // cout << "DSKDJ:ASKLDJ:AS"; vector <int> ans, dp(r+1, 0), path(r+1, -1); dp[0] = 1; path[0] = -1; for(int coin = 0; coin < a.size(); coin ++) { // cout << coin << " "; for(int j = r; j >= 0; j --) { if(j-a[coin] >= 0) { if(dp[j-a[coin]]) { dp[j] |= dp[j-a[coin]]; path[j] = coin; } } } } for(int i = l; i <= r; i ++) { if(dp[i]) { for(int u = i;;) { if(path[u] == -1) break; ans.push_back(path[u]); u -= a[path[u]]; } return ans; } } return ans; }

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

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