이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "molecules.h"
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define pf push_front
#define vi vector<ll>
#define vii vector<vi>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define all(a) a.begin(), a.end()
#define fi first
#define se second
using namespace std;
const ll mod = 1e9 + 7;
const ll inf = 2e18;
const ll blocksz = 320;
const ll N = 2e5 + 8;
pll a[N];
std::vector<int> find_subset(int l, int r, std::vector<int> x){
ll n = x.size();
for(ll i = 0; i < n; i++) a[i].fi = x[i], a[i].se = i;
sort(a,a+n);
vector<int> ans;
ll j = 0, sum = 0;
for(ll i = 0; i < n; i++){
sum += a[i].fi;
while((sum > r || a[i].fi-a[j].fi > r-l) && j <= i){
sum -= a[j].fi;
j++;
}
if(l <= sum){
for(ll x = j; x <= i; x++) ans.pb(a[x].se);
break;
}
}
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... |