| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 878274 | HuyQuang_re_Zero | Detecting Molecules (IOI16_molecules) | C++14 | 42 ms | 9772 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 ll long long
#define db long double
#define II pair <ll,ll>
#define III pair <ll,II>
#define IV pair <vector <int>,vector <int> >
#define TII pair <treap*,treap*>
#define fst first
#define snd second
#define BIT(x,i) ((x>>i)&1)
#define pi acos(-1)
#define to_radian(x) (x*pi/180.0)
#define to_degree(x) (x*180.0/pi)
#define Log(x) (31-__builtin_clz((int)x))
#define LogLL(x) (63-__builtin_clzll((ll)x))
using namespace std;
#include "molecules.h"
vector<int> find_subset(int l,int r,vector<int> vec)
{
vector <II> a;
vector <int> res;
for(int x:vec)
{
int tg=a.size();
a.push_back({ x,tg });
}
sort(a.begin(),a.end());
ll sum=0,j=0;
for(int i=0;i<a.size();i++)
{
sum+=a[i].fst;
while(sum>r) sum-=a[j++].fst;
if(sum>=l)
{
for(int k=j;k<=i;k++) res.push_back(a[k].snd);
return res;
}
}
return res;
}
/*
int main()
{
freopen("molecules.inp","r",stdin);
freopen("molecules.out","w",stdout);
int l,r,x;
vector <int> vec;
cin>>l>>r;
while(cin>>x) vec.push_back(x);
vector <int> res=find_subset(l,r,vec);
for(int x:res) cout<<x<<" ";
}
*/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... | ||||
