| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 390413 | marat0210 | Detecting Molecules (IOI16_molecules) | C++14 | 0 ms | 0 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>
#include "molecules.h"
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w) {
    vector <int> res;
    int mi = l / w[0];
    if (mi * w[0] < l and w.size() >= mi) {
        if (mi * w[0] + w[0] >= l and mi * w[0] + w[0] <= u and w.size() >= mi + 1) {
            for (int i = 0; i < mi + 1; ++i) {
                res.push_back(i);
            }
            return res;
        }
    }
    else if (mi * w[0] >= l and mi * w[0] <= r and w.size() >= mi) {
        for (int i = 0; i < mi; ++i) {
            res.push_back(i);
        }
        return res;
    }
    return vector<int>();
}
