# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1194197 | PlayVoltz | Detecting Molecules (IOI16_molecules) | C++20 | 34 ms | 3656 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
vector<int> find_subset(int low, int high, vector<int> w){
vector<pii> vect(w.size());
vector<int> ans;
for (int i=0; i<w.size(); ++i)vect[i]=mp(w[i], i);
sort(vect.begin(), vect.end());
for (long long l=0, r=0, sum=0; r<w.size(); ++r){
sum+=vect[r].fi;
while (sum>high)sum-=vect[l].fi, ++l;
if (sum>=low){
for (int j=l; j<=r; ++j)ans.pb(vect[j].se);
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... |