pranav232323's blog

By pranav232323, history, 3 months ago, In English

I'm getting TLE despite having an optimal time complexity: $$$O(nk)$$$ where $$$k$$$ is the target and $$$n$$$ is the number of coins. I even tried optimizing the modulo operation according to https://codeforces.com/blog/entry/77506, but I still have one test case that keeps TLE-ing. Further, downloading and running that test case locally indicates that my code is executing in well under the time limit of $$$1$$$ second.

Is there anything I can do at this point?

Submission: https://cses.fi/paste/6a1dc1e39bbd5552186afe/

Problem: https://cses.fi/problemset/task/1635

P.S. Tagging pllk in case this is an issue with the judging servers.

Read more »

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

By pranav232323, history, 3 months ago, In English

So, I've been using LeetCode to do some topic-wise practice on DP.

In particular, I've been doing the questions tagged medium and hard.

However, while I can usually solve the mediums in a reasonable time frame, I struggle to make any progress at all on the hards. As a result, I've been wondering whether or not I should attempt them at all at this stage. My official rating is $$$896$$$, but I think I'm around $$$1200$$$ since I haven't completed $$$6$$$ contests yet. In terms of goals, I'm trying to get comfortable with DP questions at the range of Div 2C.

Thus, my question is two-fold

1) How would you estimate the CF rating of LeetCode hard problems?

2) Should I continue solving LeetCode hards or just look for DP problems in the range of rating $$$\pm\ 200$$$.

Read more »

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

By pranav232323, history, 3 months ago, In English

Hey guys,

The following submission keeps getting TLE even though it has the same time complexity as the official solution ($$$\mathcal{O}(n)$$$)

Submission: https://codeforces.com/contest/1430/submission/104613827

Problem: https://codeforces.com/problemset/problem/1430/C

Any ideas about what's going on?

Read more »

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