Can someone please suggest some 20-30 1600-rated good DP problems? I was practising by filtering on problem sets, but most of them were based on the same repeated concepts. If you have any other resources please share.

# | User | Rating |
---|---|---|

1 | tourist | 3771 |

2 | jiangly | 3688 |

3 | Um_nik | 3539 |

4 | slime | 3498 |

5 | djq_cpp | 3486 |

6 | MiracleFaFa | 3466 |

7 | ksun48 | 3452 |

8 | Radewoosh | 3406 |

9 | greenheadstrange | 3393 |

10 | xtqqwq | 3382 |

# | User | Contrib. |
---|---|---|

1 | -is-this-fft- | 183 |

2 | awoo | 182 |

3 | YouKn0wWho | 177 |

4 | Um_nik | 175 |

5 | dario2994 | 172 |

5 | Monogon | 172 |

7 | antontrygubO_o | 167 |

7 | maroonrk | 167 |

7 | adamant | 167 |

10 | errorgorn | 164 |

I am getting TLE in this CSES problem.

I have used `Floyd Cycle Detection Algorithm`

to find out the size of the cycle.

Now the answer for all the nodes which are a part of the cycle is the `size of cycle`

.

And for the other nodes, ans is = `size_of_cycle + minimum_distance_of_a_node_which_is_a_part_of_cycle`

.

This approach passed all the test cases except 4 (in which it is showing TLE). Here is the link to the code Code I think the time complexity of my solution is $$$O(N)$$$.

Can anyone please tell me why it is showing TLE?

This problem came in today's `Leetcode Weekly contest 296`

.

The solution to this problem is pretty straightforward.**But my question is**:

how can I solve the problem if the condition: `operations[i][1] does not exist in nums`

is not necessarily true.

Input: nums = [1,2,3,4], operations = [[2,3],[3,1],[1,4]]

Output: [4,4,4,4]

Can anyone please help me?

**Question**: You are given a set of points and you have to find out the maximum points which lie on the same line.

Now this question is available on both Uva and Leetcode. But the same test case gives different outputs in different OJs.

- Test Case in Leetcode input format
- Test Case in Uva input format
**According to the Leetcode**: The answer is`5`

**According to the test case on UDebug**: The answer is`6`

Can anyone please look into this matter? That would be a great help.

Codeforces (c) Copyright 2010-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/08/2022 03:22:59 (j1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|