# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
424931 | Ahmadsm2005 | Detecting Molecules (IOI16_molecules) | C++14 | 57 ms | 6164 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 "grader.cpp"
#include<bits/stdc++.h>
using namespace std;
vector<int>find_subset(int l,int u,vector<int>w){
vector<int>ANS;
long long SUM=0;
int L=0;
vector<pair<int,int>>CRAP;
for(int i=0;i<w.size();i++)
CRAP.push_back({w[i],i});
sort(CRAP.begin(),CRAP.end());
for(int i=0;i<w.size();i++){
SUM+=CRAP[i].first;
while(SUM>u)
SUM-=CRAP[L].first,L++;
if(SUM>=l&&SUM<=u){
for(int l=L;l<=i;l++)
ANS.push_back(CRAP[l].second);
return ANS;
}
}
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... |