# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
569498 | penguin133 | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 316 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;
int P[200005];
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
for(int i=0;i<w.size();i++){
P[i+1] = P[i] + w[i];
}
for(int i=0;i<w.size();i++){
int s = i, e = w.size() - 1, ans = s-1;
while(s <= e){
int m = (s + e)/2;
if(P[m+1] - P[i] > u)e = m - 1;
else ans = m, s = m + 1;
}
if(P[ans+1] - P[i] >= l && P[ans+1] - P[i] <= u){
vector<int>ans1;
for(int j=i;j<=ans;j++)ans1.push_back(j);
return ans1;
}
}
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... |