#include "molecules.h"
#include <bits/stdc++.h>
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
vi find_subset(int l, int u, vi w)
{
int n=sz(w);
vpi par;
vi res;
for (int i=0;i<n;i++)par.pb({w[i],i});
for (int i=0;i<n-1;i++)
{
for (int j=i;j<n-1;j++)
{
if (par[j].f>par[j+1].f)
{
swap(par[j],par[j+1]);
}
}
}
int q1=0,q2=n-1,jem=0;
while(1)
{
if (jem+par[q2].f>u)break;
jem+=par[q2].f;
res.pb(par[q2].s);
q2--;
}
if (jem>=l)return res;
while(1)
{
if (jem+par[q1].f>u)break;
jem+=par[q1].f;
res.pb(par[q1].s);
q1--;
}
if (jem<l)res.clear();
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
416 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
384 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
17 |
Incorrect |
0 ms |
256 KB |
Integer 4 violates the range [0, 3] |
18 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Contestant can not find answer, jury can |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
416 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
384 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
17 |
Incorrect |
0 ms |
256 KB |
Integer 4 violates the range [0, 3] |
18 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
416 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
384 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
17 |
Incorrect |
0 ms |
256 KB |
Integer 4 violates the range [0, 3] |
18 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
416 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
384 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
17 |
Incorrect |
0 ms |
256 KB |
Integer 4 violates the range [0, 3] |
18 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
416 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
384 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
17 |
Incorrect |
0 ms |
256 KB |
Integer 4 violates the range [0, 3] |
18 |
Halted |
0 ms |
0 KB |
- |