Problem in solving question 1829G : Hits Different

Revision en2, by godmodegod, 2024-08-21 19:46:58

Here's my attempt at solving the problem 1829G

I've started from the bottom nth row and worked my way up from there. The set considered has all the values that have already been taken before. This solution fails for the sample test case when n = 1434( gives 80385350, should give 63145186)

Code

Where am I messing up here?

Tags dp, geometry, div.4

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English godmodegod 2024-08-21 19:46:58 238
en1 English godmodegod 2024-08-21 19:46:10 3163 Initial revision (published)