# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
715658 | ovidiush11 | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 340 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>
#include "molecules.h"
using namespace std;
#define ll long long
std::vector<int> find_subset(int l, int u, std::vector<int> w)
{
ll n = w.size();
vector<pair<ll,ll>> a(n);
for(ll i = 0;i < n;i++)a[i] = {w[i],i};
sort(a.begin(),a.end());
ll N = n,s = 0;
while(N != 0 && s + w[N-1] < l){s += a[N-1].first;N--;}
if(N == n)
{
for(int i = 0;i < n;i++)if(w[i] >= l && w[i] <= u)return {i};
return {};
}
if(N == 0)return {};
N = n - N;s = 0;
vector<pair<ll,ll>> p(n-N);
for(ll i = N;i < n;i++)p[i-N] = a[i];
for(ll i = 0;i < N-1;i++)s += a[i].first;
ll k = 0;
for(ll i = N-1;i < n;i++)
{
s += a[i].first;
ll left = 0,right = n-N-1;
# | 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... |