# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
739029 | ThylOne | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 212 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>
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<int> prefixSum;
prefixSum.push_back(0);
for(int i=0;i<w.size();i++){
prefixSum.push_back(prefixSum[i]+w[i]);
}
vector<int> R;
for(int I=0;I<w.size();I++){
if(w[I]>=l && w[I]<=u){return {I};}
for(int j=0;j<I;j++){
int score = prefixSum[I+1]-prefixSum[j];
if(score>=l && score<=u)return {j,I};
}
}
return {};
}
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... |