#/****Bismillahir rahmanir rahim****/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
#define All(a) a.begin(), a.end()
template <typename T>
void get_vector(T &a)
{
for (auto &e : a)
cin >> e;
}
template <typename T>
void put_vector(T a)
{
for (auto e : a)
cout << e << " ";
cout << endl;
}
vector<int> find_subset(int l, int u, vi w)
{
int n =w.size();
vector<pair<int,int>> a(n);
for(int i = 0; i<n ; i++){
a[i] = {w[i],i+1};
}
sort(All(a));
ll sum = 0;
int i;
for(i = 0; i<n; i++){
sum += a[i].first;
if(sum>=l)break;
}
if(sum>u)return {};
vi res(i+1);
for(int j = 0; j<=i; j++){
res[j] = a[j].second;
}
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Integer 2 violates the range [0, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Contestant can not find answer, jury can |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Integer 2 violates the range [0, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Integer 2 violates the range [0, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Integer 2 violates the range [0, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Integer 2 violates the range [0, 1] |
2 |
Halted |
0 ms |
0 KB |
- |