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 "molecules.h"
#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,e) for (int i = s; i <= e; ++i)
#define rrep(i,s,e) for (int i = s; i >= e; --i)
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define all(a) a.begin(), a.end()
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<ll> vll;
vi find_subset(int l, int u, vi w) {
int n = w.size();
vi w_org = w;
sort(all(w));
ll sum = 0;
rep (i,0,n-1) {
sum += w[i];
if (sum>u) {
sum -= w[i];
rep (j,0,i) {
if (sum>=l) {
map<int,int> want;
rep (k,0,i-1) {
if (k<j) want[w[n-1-k]]++;
else want[w[i-1-k]]++;
}
vi ans;
rep (k,0,n-1) {
if (want[w_org[k]]) {
ans.pb(k);
want[w_org[k]]--;
}
}
return ans;
}
if (j<i) sum += w[n-1-j]-w[i-1-j];
}
return vi();
}
}
if (sum>=l) {
vi ans;
rep (i,0,n-1) ans.pb(i);
return ans;
}
return vi();
}
# | 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... |