제출 #715635

#제출 시각아이디문제언어결과실행 시간메모리
715635ovidiush11Detecting Molecules (IOI16_molecules)C++14
9 / 100
1 ms212 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; std::vector<int> find_subset(int l, int u, std::vector<int> w) { int n = w.size(); sort(w.begin(),w.end()); vector<int> result; while(n != 0 && w[n-1] < l) { result.push_back(n-1); l -= w[n-1];u -= w[n-1]; n--; } if(n == 0)return {}; result.push_back(n-1); if(w[n-1] <= u)return result; for(int i = 0;i < n-1;i++) { if(w[i] + w[n-1] >= l + w[w.size()-1] && w[i] + w[n-1] <= u + w[w.size()-1]) { result[0] = i; return result; } } return {}; }
#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...