naivedyam's blog

By naivedyam, 4 hours ago, In English

My solution to B — Cryptography gives a TLE on test case 13 even though (I feel) my solution meets the constraints. I am building the segment tree in O(n) and answering m queries in O(mlogn). So even in the worst case my solution should run in < 4e6 operations right? Then why a TLE?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By naivedyam, 3 weeks ago, In English

THIS PROBLEM from Codeforces Edu section seems to be an exact replica of CSES problem DYNNAMIC RANGE QUERIES. I solved the CSES one and it passed but solving the Codeforces one was giving runtime error. Tried fixing it but didn't help much. Even the one that passed on CSES dosen't pass on CPH and gives Runtime error on my VS Code too. So I decided to copy the same code that passed on CSES and try it here on codeforces but for some reason, even the code that passed on CSES is giving me runtime error on Codeforces too! It is not even a difference in the version of C++ since on both the sites I used C++20.

THIS IS MY CSES CODE

While [submission:286148512] is my Codeforces submission (both are same since I tried pasting the same code after 2 runtime errors). Could someone explain why this weird behavior even while using the same C++ versions? And why is my CSES submission getting AC on CSES but giving run time error on both codeforces and vs code?

Full text and comments »

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

By naivedyam, history, 2 months 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, 3 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, 3 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