# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
661180 | GoldLight | Detecting Molecules (IOI16_molecules) | C++17 | 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>
using namespace std;
vector<int> find_subset(int l, int r, vector<int> w){
bool cek=true, beda=true;
for(int i=1; i<w.size(); i++){
if(w[i]!=w[i-1]) cek=false;
if(abs(w[i]-w[i-1])>=2) beda=false;
}
vector<int> ans;
if(cek){
int sum=0;
for(int i=0; i<w.size(); i++){
sum+=w[i];
ans.push_back(i);
if(sum>=l) break;
}
if(sum<l || sum>r) ans.clear();
}
return ans;
/*
else if(beda){
int minx=1000, maxn=-1000;
for(int i=0; i<w.size(); i++){
minx=min(minx, w[i]);
maxn=max(maxn, w[i]);
}
vector<int> a, b;
for(int i=0; i<w.size(); i++){
if(w[i]==minx) a.push_back(i);
else b.push_back(i);
}
bool cek=false;
int sum=0;
vector<int> aa, bb;
for(int i=0; i<a.size(); i++){
sum+=minx;
aa.push_back(a[i]);
if(l-sum<=min(b.size(), aa.size())){
break;
}
if(sum>=l){
break;
}
}
if(sum>r) return ans;
if(sum>=l && sum<=r) return aa;
if(l-sum<=min(b.size(), aa.size())){
for(int i=0; i<aa.size(); i++) ans.push_back(aa[i]);
for(int i=0; i<l-sum; i++) ans.push_back(b[i]);
return ans;
}
for(int i=0; i<b.size(); i++){
sum+=maxn;
bb.push_back(b[i]);
}
}
*/
}
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... |