# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
995718 | kokoue | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 348 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>
#define maxn 1000000
using namespace std;
//set<long long> is;
unordered_map<int,bool> is;
unordered_map<long long,long long> idx;
vector<int> find_subset(int l,int u,vector<int> w)
{
int n=w.size();
is[0]=1;
idx[0]=0;
int sum=0;
bool fl=0;
int mx=0;
vector<pair<int,int>> a;
for(int i=0;i<n;i++) a.push_back({w[i],i});
sort(a.begin(),a.end());
vector<int> res;
int ll=0,r=0;
for(int i=0;i<n;i++)
{
sum+=a[i].first;
while(sum>u)
{
sum-=a[ll].first;
ll++;
}
if(l<=sum && sum<=u)
{
for(int j=ll;j<=i;j++) res.push_back(j);
return res;
}
}
return res;
}
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... |