# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
132932 | wzy | Detecting Molecules (IOI16_molecules) | C++11 | 66 ms | 6380 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 "molecules.h"
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<pii> v;
for(int i = 0 ; i < w.size() ; i ++) v.push_back({w[i] , i});
sort(v.begin() , v.end());
int lx = 0 ;
long long curr = 0;
for(int i = 0 ; i < w.size(); i ++){
curr += (long long) v[i].first;
while(curr > (long long)u && lx != (i)){
curr -= (long long) v[lx].first;
lx++;
}
if(curr <= (long long) u && curr >= (long long)l){
vector<int> p ;
for(int j = lx ; j <= i ; j ++){
p.push_back(v[j].second);
}
return p;
}
}
return vector<int>();
}
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... |