# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
553222 | sandry24 | Detecting Molecules (IOI16_molecules) | C++17 | 1 ms | 292 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>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
vi find_subset(int l, int u, vi w){
sort(w.begin(), w.end(), greater<int>());
ll sum = 0;
int ind = 0;
vector<int> visited(w.size());
while(ind != w.size()){
if(sum + w[ind] < l){
sum += w[l];
visited[ind] = 1;
}
ind++;
}
vi ans;
for(int i = w.size()-1; i >= 0; i--){
if(!visited[i]){
sum += w[i];
visited[ind] = 1;
break;
}
}
if(sum >= l && sum <= u){
for(int i = 0; i < w.size(); i++){
if(visited[i])
ans.pb(i);
}
}
return ans;
}
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... |