# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
851280 | askow | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 412 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;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
int n=w.size();
int subtask1=0;
set<int>s;
for(int i=0;i<n;i++)s.insert(w[i]);
int C=0;
for(int i=0;i<n;i++)C+=w[i];
if(C<l)return {};
if(s.size()==1)subtask1=1;
if(subtask1){
int sum=0;
vector<int>ans;
for(int i=0;i<n;i++){
if(sum+w[i]>u)break;
sum+=w[i];
ans.push_back(i);
}
return ans;
}
}/*
int main(){
int n,u,v;
cin>>n>>u>>v;
vector<int>a(n);
for(int i=0;i<n;i++)cin>>a[i];
for(auto it:find_subset(u,v,a))cout<<it<<" ";
}*/
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... |