# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
198372 | Ruxandra985 | Detecting Molecules (IOI16_molecules) | C++14 | 2 ms | 376 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;
vector <int> sol;
pair <int,int> x[200010];
vector <int> find_subset (int l , int u , vector <int> v){
int i , sum , j , k;
for (i=0;i<v.size();i++){
x[i] = make_pair(v[i] , i);
}
sort (x , x + v.size());
sum = 0;
j = -1;
for (i=0 ; i < v.size() ; i++){
sum -= x[i-1].first;
if (j < i){
j = i;
sum += x[i].first;
}
while (j+1 < v.size()){
sum += x[j+1].first;
if (sum > u){
sum -= x[j+1].first;
break;
}
if (l <= sum && sum <= u){
for (k = i ; k <= j + 1 ; k++){
sol.push_back(x[k].second);
}
return sol;
}
j++;
}
}
sol.clear();
return sol; /// nu se poate;
}
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... |