이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "molecules.h"
//#include "grader.cpp"
using namespace std;
//#define int long long
#define endl "\n"
#define all(v) v.begin(),v.end()
#define gen(arr,n,nxt) generate(arr,arr+n,nxt)
#define Blobo2 ios_base::sync_with_stdio(false);cin.tie(0);
vector<int> find_subset(int l, int u, vector<int> w) {
vector<pair<int,int> >v;
for(int i=0;i<(int)w.size();i++)v.push_back({w[i],i});
sort(all(v));
int cnt=0,s=0;
vector<int>ans;
for(int i=0;i<(int)v.size();i++){
cnt += v[i].first;
while(cnt > u){
cnt -= v[s].first;
s++;
}
if(cnt <=u && cnt>= l){
for(int j=s;j<=i;j++)ans.push_back(v[j].second);
break;
}
}
sort(all(ans));
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... |