Please read the new rule regarding the restriction on the use of AI tools. ×

naivedyam's blog

By naivedyam, history, 3 weeks ago, In English

Why is my solution 281599833 failing on case 5? What is the issue with my logic?

Full text and comments »

  • Vote: I like it
  • -3
  • Vote: I do not like it

By naivedyam, history, 6 weeks ago, In English

I am stuck on my solution to 277938667. It gets stuck on testcase 2 subcase 21 and since it is interactive I can neither debug it nor see the specific test case where it fails.

Here is my approach — I will first query the point (1,1) and find the distance of the closest mine to it. If the distance is 0 that's the location of the mine so I return. Else, all the possible cells where the mine can lie are along a diagonal of the rectangle. Now, I query the starting and ending points of the diagonals. Again if the distance is 0 I report them. Else, there are two possible cases — either both return the distance to the mine on the diagonal or one returns that mine and the other returns distance to a cell to the other mine. Now Here, I know the cells lying on the diagonal follow a certain pattern. I assume both of the distances I got while querying those points to be distances to a mine on the diagonal and calculate the coordinates of those cells accordingly. Now for the last query, I query about one of the cells I calculated. If the distance is 0 that is my answer. Else, the other one has to be my answer. I don't see anything wrong with the approach. Can someone help?

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it

By naivedyam, history, 7 weeks ago, In English

Can someone point out what's wrong with this solution 277417581? PS — I am neither good with trees nor with interactive problems. Had to submit it while reading the blog and learning from test cases. In the dry run it did pass for example 1 though but submitting it said "int 32 expected" while the problem clearly asked me to submit it after an ! mark. Also, if there is any flaw in the logic please point it out as well. My approach was I would take a as 1 and iterate it through all the values of b from 1 to n. Since it is a tree and not a graph, I believe every edge will be connected to either directly or through intermediate nodes. So if the query gives 1 I push back 1 and b else x and b because let's say the query gave x = 3, then 3 is connected to both 1 and 4 so we gotta pass both 1 3 and 3 4 but since I am iterating over all values of b, 1 3 should be there already so I just need to pass 3 4, am I on the right track?

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it

By naivedyam, history, 2 months ago, In English

In last Edu Div2 round 12000ish people solved 3 problems. Today's Div 2, 8000ish people solved 3. What has happened all of a sudden since last 2 contests? My rank is going extremely down even after improving earlier I used to get positive change even after solving 2 problems. I have seen profiles of people getting positive change in specialist range after solving 2 div 2s in a contest getting ranks under 3k. But since past 2 contests it seems impossible for even a pupil to get a positive change after solving 3. I solved 3 problems today but could only get 6460 rank at the end.

Full text and comments »

  • Vote: I like it
  • +28
  • Vote: I do not like it

By naivedyam, history, 2 months ago, In English

I have just started recursion and while most of the concepts were pretty easy for me to understand and apply, I am stuck with one particular one — the famous Subset problem of Leetcode where you have to return all possible subsets of a set. I have seen the solution, watched an explanation but still feel I don't truly understand it. Never been so much stuck with a problem before. Also, I don't think it is a problem that can be skipped because since the time I first saw it (last week) I have reduced 5 different problems to it including one in a contest (which I obviously couldn't implement even after figuring out the logic because I can't solve the subset problem). I have also reduced some CSES problems like Apple Divison to it, but again, unable to solve for the same reason. Could anyone suggest any resources for the same?

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it

By naivedyam, history, 2 months ago, In English

I am facing a problem of having two different entries of my college in the organization part. One is National Institute of Technology Durgapur which I have currently kept and the other is NIT Durgapur which is the same college but the names written in a short form. Now the problem is both these sections seem to have different rank lists of their own and both are of the students of my college and I can't simultaneously be in both of them. Is there a way to merge the two?

Full text and comments »

  • Vote: I like it
  • -1
  • Vote: I do not like it