#include "molecules.h"
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fore(i,a,b) for(lli i = (a), abcdxd = (b); i < abcdxd; i++)
#define f first
#define s second
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define ENDL '\n'
#define sz(s) lli((s).size())
#define pb push_back
using namespace std;
typedef int lli;
// typedef long long LLI;
typedef pair<lli, lli> ii;
typedef vector<lli> vi;
typedef vector<ii> vii;
typedef long double ld;
#define deb(x) cout << #x << ": " << x << endl;
#define BIGLLI __int128
std::vector<int> find_subset(int l, int r, std::vector<int> w) {
lli n = sz(w);
vii v(n); fore(i,0,n){
v[i].f = w[i];
v[i].s = i;
}
sort(rall(v));
fore(k,0,n){
lli sum = 0;
fore(i,k,n){
sum += v[i].f;
if (l <= sum && sum <= r){
vi ans;
fore(j,k,i+1) ans.pb(v[j].s);
return ans;
}
}
}
return {};
}
Compilation message (stderr)
molecules.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
molecules_c.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
# | 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... |