제출 #1129385

#제출 시각아이디문제언어결과실행 시간메모리
1129385NAMINDetecting Molecules (IOI16_molecules)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; vector<bool> take; pair<vector<int>,bool> solve(int l,int u,vector<pair<int,int>>& W){ if(l <= 0) return {{},true}; vector<int> ans; bool ok = false; for(int i=0;i<W.size();i++){ if(W[i].first > u || take[i]) continue; take[i] = true; auto res = find_subset(l-W[i].first,u-W[i].first); ans = res.first; ans.push_back(W[i].second); ok = res.second; if(ok){ break; } take[i] = false; } return {ans,ok}; } vector<int> find_subset(int l, int u,vector<int> w) { take.assign(w.size(),false); vector<pair<int,int>> W; for(int i=0;i<w.size();i++){ W.push_back(make_pair(w[i],i)); } sort(W.begin(),W.end()); return solve(l,u,W).first; }

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

molecules.cpp: In function 'std::pair<std::vector<int>, bool> solve(int, int, std::vector<std::pair<int, int> >&)':
molecules.cpp:17:39: error: too few arguments to function 'std::vector<int> find_subset(int, int, std::vector<int>)'
   17 |                 auto res = find_subset(l-W[i].first,u-W[i].first);
      |                            ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from molecules.cpp:2:
molecules.h:5:18: note: declared here
    5 | std::vector<int> find_subset(int l, int u, std::vector<int> w);
      |                  ^~~~~~~~~~~
molecules.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
molecules_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~