#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
#define double long double
#define pon ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); int T=1;
#define ponchik signed main
#define pb push_back
#define pf push_front
#define endl "\n"
#define F first
#define S second
const long long N=1e5+69,INF=1e18+1488;
vector<int> find_subset(int l, int u, vector<int> w) {
// freopen( "###.in" ,"r",stdin); freopen( "###.out" ,"w",stdout);
// cin>>T;
long long n=w.size(),a=l,b=u;
sort(w.begin(),w.end());
long long l1=0,r=0,sum=w[0];
vector <int> ans;
while (l1<=r&&l<n)
{
if (sum>=a&&sum<=b)
{
for (int i=l1; i<=r; i++) ans.pb(w[i]);
return ans;
}
if (sum+w[r+1]<a) r++,sum+=w[r];
else if (sum+w[r+1]>b) l1++,sum-=w[l1-1];
}
return {};
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
0 ms |
348 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Contestant can not find answer, jury can |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
0 ms |
348 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
0 ms |
348 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
0 ms |
348 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
0 ms |
348 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |