ATC - Editorial

PROBLEM LINK:

Contest

Author: Chhekur

Tester: Pankaj Devesh

Editorialist: Pawan Kushwah

DIFFICULTY:

Easy

PREREQUISITES:

Basic DP

PROBLEM:

You have to find out nth term of given series.

EXPLANATION:

You are given the following expression:

N = (F(N) - F(N-1))2

In order to find the nth term of given series, you have to modify the above expression as follows:

F(N) = F(N-1) + √N

In order to avoid TLE, you must memoize previous results.

Author’s solution can be found here.