| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 299367 | APROHACK | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 384 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 "molecules.h"
#include <bits/stdc++.h>
#define PB push_back
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w) {
vector<int>respuesta;
//sort(w.begin(), w.end());
long long sum=0, n=w.size();
long long menor=w[0], mayor=w[n-1], nn=0, mm=0;
set<int>menores, mayores;
for(int i = 0 ; i < n ; i ++){
if(w[i]==menor)nn++;
else mm++;
if(w[i]==menor)menores.insert(i);
else mayores.insert(i);
}
//cout<<menor<<" "<<mayor;
for(int i = 0 ; i <= nn ; i ++){
for(int j = 0 ; j <= mm ; j++){
if(i*menor+j*mayor>=l&&i*menor+j*mayor<=u){
long long cont=0;
for(auto x:menores){
if(cont==nn)break;
cont++;
respuesta.push_back(x);
//if(cont==nn)break;
}
cont=0;
for(auto x:mayores){
if(cont==mm)break;
cont++;
respuesta.push_back(x);
}
return respuesta;
}
}
}
return respuesta;
//return std::vector<int>respuesta;
}
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... | ||||
