# a good set solve ?

okay, so I used two way to do this problem, first is using a custom fibonacci where instead of f(a) = f( a - 1 ) + f( a -2 ), I turned it into f(a) = f(a - 1 ) + f( a - 2 ) + 1, this should make sure that it meets the requirements, and it did, albeit only for the first subtask, next I used a method that will definitely meet the requirement, by having the output like this, e.g
input 1, outputs 1
input 2, outputs 1 11
input 3, outputs 1 11 111
input 4, outputs 1 11 111 1111
if the outputs are like this, there should be no way that the output donâ€™t meet the requirements, and yet I got WA for both subtaskâ€¦weird
anyways, here is my submission

You missed the constraint that all elements should be in the range 1 to 500.

2 Likes

Fibonacci grows very quickly, you probably want something that doesnâ€™t grow exponentially fast. This would be a problem even if the problem statement didnâ€™t state that numbers should be between 1 and 500 as the 100 Fibonacci number is 354224848179261915075 and doesnâ€™t even fit inside of a ulong.

A small hint:

Click to view
10,11,12,13,14,15,16,17,18,19,20

is a good set

2 Likes

welp, guess I need to pay more attention to constraint huh

gotcha, then all I need is to start it off with 10, or any number that is bigger than one edit : nvm, it is not that I can just start with numbers of any kind

There is a more beautiful way to do it than that. One hint: parity

ok, nevermind, I decided to just output 400 until 500 and it works, yeah I guess I know why, because 400 + 401 is already 801

Great! Btw about Algmyrâ€™s hint, you could just have used odd numbers =p

Please use the problem code in the title of the question while asking a question. For example, one possible title could be: â€śHelp in solving the problem GOODSETâ€ť. Also, itâ€™s good to provide the link to the problem too. Thanks for asking the question and accepting the answer

I agree that the title is not optimal, but at least the submission was linked which shows the problem in question, so it wasnâ€™t too bad at all.

wellâ€¦didnâ€™t think of that

yeah, I always put the problem link when I ask this kind of question