# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
403294 | Leonardo_Paes | Detecting Molecules (IOI16_molecules) | C++17 | 48 ms | 3420 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
vector<int> find_subset(int ll, int u, vector<int> w){
vector<int> ans;
vector<pair<int,int>> v(w.size());
for(int i=0; i<v.size(); i++) v[i] = {w[i], i};
sort(v.begin(), v.end());
int l = 0, sum = 0;
for(int r=0; r<v.size(); r++){
sum += v[r].f;
while(sum > u) sum -= v[l++].f;
if(ll <= sum and sum <= u){
while(l <= r) ans.push_back(v[l++].s);
break;
}
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |