"I tried to Find out success using binary search....But ended up realizing that my life is not sorted..."

Conclusion--->>>There are no shortcuts, do it the hardworking way

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

1 | tourist | 3757 |

2 | jiangly | 3590 |

3 | ksun48 | 3582 |

4 | Um_nik | 3539 |

5 | maroonrk | 3533 |

6 | slime | 3498 |

7 | djq_cpp | 3486 |

8 | Radewoosh | 3442 |

9 | cnnfls_csy | 3427 |

10 | ko_osaga | 3355 |

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

1 | -is-this-fft- | 184 |

2 | awoo | 181 |

3 | dario2994 | 171 |

4 | maroonrk | 168 |

4 | SecondThread | 168 |

4 | Um_nik | 168 |

7 | adamant | 166 |

8 | YouKn0wWho | 165 |

8 | errorgorn | 165 |

10 | antontrygubO_o | 162 |

"I tried to Find out success using binary search....But ended up realizing that my life is not sorted..."

Conclusion--->>>There are no shortcuts, do it the hardworking way

↑

↓

Codeforces (c) Copyright 2010-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Oct/06/2022 19:16:34 (f1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

r/iam14andthisisdeep

sort(life.begin(),life.end());

problem solved

I tried to calculate my chance for success using dp...But ended up realizing that my life is cyclic.

Then Gaussian Elimination is coming into consideration.

How can you use Gaussian elimination to solve a DP where subproblems have cyclic dependency ?

Gaussian elimination is used to solve a system of linear equations. So ... how ?

Maybe I'm not getting your point. But as I know, in some probabilities dp problems, dp equations are something like: $$$dp[i] = \sum\limits _{j\text{ is adjacent to }i} a[i][j] * dp[j]$$$, where $$$a[i][j]$$$ is some sorts of coefficient. In such case, the dp equations do turn into linear equations. :)

but what if there are no solutions?

Then print F instead.

I tried applying dp but then I realized, everything is just stupid greedy

greedy : 561 math : 488 implementation : 388 dp : 327

i believe you. :D

I tried to find out the answer of life by representing it as $$$p \times q^{-1} (mod\,M)$$$ where $$$p$$$ and $$$q$$$ are coprime but I realized life doesn't have a prime modulo, neither is life even rational...

I thought past experience will help me in life but everyday is just addhoc

But when life starts to feel monotonic, you know what to do ;)

I tried to find the Shortest path to success using Dijkstra... But ended up realizing that my life is full of negative weight edges.

...so I used Bellman-Ford.