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.


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

is a good set


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

The important thing is to not start with small numbers.

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 :slight_smile:

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