제출 #1020699

#제출 시각아이디문제언어결과실행 시간메모리
1020699mansurDetecting Molecules (IOI16_molecules)C++17
9 / 100
1 ms440 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; #define rall(s) s.rbegin(), s.rend() #define all(s) s.begin(), s.end() #define sz(s) (int)s.size() #define s second #define f first using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; vector<int> find_subset(int l, int r, vector<int> w) { sort(all(w)); ll sum = 0; deque<int> res; for (int i = 0; i < sz(w); i++) { sum += w[i]; res.push_back(i); if (sum > r) { sum -= w[res.front()]; res.pop_front(); } if (sum >= l) { vector<int> ans; for (int x: res) ans.push_back(x); return ans; } } 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...