#include "molecules.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
#define fr first
#define sc second
#define vi vector < int >
#define pi pair < int, int >
int n, lf;
ll s;
std::vector<int> find_subset(int l, int u, std::vector <int> w) {
vi ans;
n = w.size();
sort(w.begin(), w.end());
for (int i = 0; i < n; i++){
s += w[i];
if (s > u){
s -= w[lf];
lf++;
}
if (s >= l){
for (int j = lf; j <= i; j++)
ans.pb(w[j]);
break;
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
3 ms |
384 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
256 KB |
Integer 50 violates the range [0, 11] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
3 ms |
384 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
3 ms |
384 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
3 ms |
384 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
3 ms |
384 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |