# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
770622 | Benmath | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 292 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 <cstdio>
#include <vector>
#include <cassert>
*/
/*
#include<bits/stdc++.h>
using namespace std;
*/
#include "molecules.h"
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
long long int sum=0;
vector<int>ans;
for(int i=0;i<w.size();i++){
if(w[i]<=u){
sum=sum+w[i];
ans.push_back(i);
}
if(sum>=l and sum<=u){
break;
}
}
if(sum>=l and sum<=u){
return ans;
}else{
ans.clear();
return ans;}
}
/*
int main() {
int n, l, u;
assert(3 == scanf("%d %d %d", &n, &l, &u));
std::vector<int> w(n);
for (int i = 0; i < n; i++)
assert(1 == scanf("%d", &w[i]));
std::vector<int> result = find_subset(l, u, w);
printf("%d\n", (int)result.size());
for (int i = 0; i < (int)result.size(); i++)
printf("%d%c", result[i], " \n"[i == (int)result.size() - 1]);
}
*/
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... |