I started solving IOI,APIO,EJOI..... problems. And in 60%-70% of problems there is implementation details.For example. In that problem
This
Implementation details
You should implement one function (method):
int[] find_subset(int l, int u, int[] w)
l and u: the endpoints of the detection range,
w: weights of the molecules.
if the required subset exists, the function should return an array of indices
of molecules that form any one such subset. If there are several correct
answers, return any of them.
if the required subset does not exist, the function should return an empty
array.
For the C language the function signature is slightly different:
int find_subset(int l, int u, int[] w, int n, int[] result)
n: the number of elements in w (i.e., the number of molecules),
the other parameters are the same as above.
instead of returning an array of indices (as above), the function should
write the indices to the first cells of array result and then return .
if the required subset does not exist, the function should not write anything
to the result array and it should return .
Your program may write the indices into the returned array (or to the result array
in C) in any order.
[l, u]
l u
n w0,…, wn−1
I = {i1,…,im}
l ≤ wi1 + … + wim ≤ u
l u
u − l ≥ wmax − wmin wmax = max(w0,…, wn−1)
wmin = min(w0,…, wn−1)
m
m m
0
2 / 2
Please use the provided template files for details of implementation in your
programming language.
And there is place:
And this
Sample grader The sample grader reads the input in the following format: line 1: integers , , . line 2: integers: .
What to do in such problems help please!