My code gets RTE.
Is my method of taking input wrong?
Please help
![:roll:](./images/smilies/icon_rolleyes.gif)
Code: Select all
cut after AC
Moderator: Board moderators
Code: Select all
cut after AC
To dust_cover:dust_cover wrote:can anybuddy tell me what should be the output for inout 0 & 1.....I am getting WA.
I used BigInt library
Also used the standard formula for the problem!
Thanx in advance
I just count the number of intersection and add 2.soyoja wrote:I read previous article that the key formula for solving this problem is
"f(n) = n^2 - n + 2 ".
But I'm very anxious how can generate this formula....
Could anyone explain this principle?
Code: Select all
0
1
4589723412211934134013
1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Code: Select all
1
2
21065561000606359857403149578459628309350158
999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002