제출 #699930

#제출 시각아이디문제언어결과실행 시간메모리
699930elkernosDetecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms296 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define ssize(x) (int)size(x) vector<int> find_subset(int l, int u, vector<int> w) { vector<pair<int, int>> pairs(ssize(w)); for (int i = 0; i < ssize(w); i++) pairs[i] = {w[i], i}; sort(pairs.begin(), pairs.end()); vector<ll> sum(ssize(w) + 1); for (int i = 0; i < ssize(w); i++) sum[i + 1] = sum[i] + pairs[i].first; for (int i = 1; i <= ssize(w); i++) { int where = lower_bound(sum.begin(), sum.begin() + i, sum[i] - u) - sum.begin(); if (sum[i] - sum[where] >= l) { vector<int> wyp; for (int j = where + 1; j <= i; j++) wyp.push_back(pairs[i].second); return wyp; } } return vector<int>(); }
#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...