# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
140454 | bazsi700 | Detecting Molecules (IOI16_molecules) | C++14 | 63 ms | 7160 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;
#define MOD 1000000007
#define ll long long int
#define vi vector<int>
#define vii vector< vector<int> >
#define PI 3.1415926535897932384626433832795
#define INF 9223372036854775807LL
#define hashA 1257958787
#define hashB 1539500609
#define endl "\n"
vector<int> find_subset(int l, int u, vector<int> w) {
int n = w.size();
vector<pair<ll,int> > vec (n);
ll sum = 0;
vector<int> ans;
for(int i = 0; i < n; i++) {
vec[i] = {w[i],i};
if(l <= w[i] && w[i] <= u) {
ans.push_back(i);
return ans;
}
sum+= w[i];
}
sort(vec.begin(),vec.end());
if(vec[0].first > u || sum < l) {
return ans;
# | 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... |