제출 #71809

#제출 시각아이디문제언어결과실행 시간메모리
71809XmtosXDetecting Molecules (IOI16_molecules)C++17
9 / 100
4 ms932 KiB
#include <bits/stdc++.h>
#include "molecules.h"
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w)
{
    vector <int> ans;
    sort(w.begin(),w.end());
    int cur=0;
    int n=w.size();
    for (int i=0,j=0;j<n;j++)
    {
        cur+= (w[j]);
        while (cur>u)
        {
            cur-=w[i];
            i++;
        }
        if (cur>=l)
        {
            for (int q=i;q<=j;q++)
            {
                ans.push_back(q);
            }
            return ans;
        }
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...