# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40638 | leejseo | Detecting Molecules (IOI16_molecules) | C++98 | 75 ms | 35884 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;
typedef long long lld;
vector< pair<lld, lld> > L;
lld fr[200002];
lld bk[200002];
vector<int> find_subset(int l, int u, vector<int> w) {
int N = w.size();
for (int i=0; i<N; i++){
L.push_back(make_pair(w[i], i));
}
sort(L.begin(), L.end());
for (int i=0; i<N; i++){
if (i == 0){
fr[i] = L[i].first;
bk[i] = L[N-i-1].first;
continue;
}
else{
fr[i] = fr[i-1] + L[i].first;
bk[i] = bk[i-1] + L[N-i-1].first;
}
}
vector<int> ans;
for (int k=0; k<N; k++){
if (fr[k] > u) break;
if (fr[k] >= l && fr[k] <= u){
# | 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... |