# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1019842 | Salty | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 348 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;
vector<int> find_subset(int l, int u, vector<int> w) {
vector<int> ans,blank;
vector<int> temp;
temp = w;
sort(w.begin(),w.end());
unordered_map<int,int> mp;
for(auto val:w){
mp[val]++;
}
int w1 = w[0], w2 = w[w.size()-1];
int sm = 0;
for(int i = 0; i < mp[w1]; i++){
if(sm < l) {
sm+=w[i];
ans.push_back(i);
}
else break;
}
if(sm <= u) return ans;
else return blank;
}
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... |