# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
697109 | _Knyaz_ | Detecting Molecules (IOI16_molecules) | C++17 | 1 ms | 340 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;
vector<int> find_subset(int l, int u, vector<int> w){
sort(w.begin(), w.end());
vector<int> zero = {0};
int sum = w[0], n = w.size();
if(l <= sum && sum <= u) return zero;
int L = 0, R = 1;
while(R<n){
if(sum<=u) sum += w[R++];
if(sum>u) sum -= w[L++];
if(l<=sum && sum<=u){
vector<int> vec; for(int i = L; i < R; i++) vec.push_back(i);
return vec;
}
}
}
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... |