|
|
| Show all threads Hide all threads Show all messages Hide all messages | | Is there any solution aside from DP? | Aleksander | 2173. Meta-statement 3 | 24 Feb 2026 02:55 | 3 | I solved it using pretty straigtforward DP O(n * m^2), obviously it's just a complexity without any additional factors but it doesn't seem to be fitting time limit. Somehow it did. But I wonder, is there any more intricate idea for a faster solution? pretty straigtforward DP O(n * m^2) it doesn't seem to be fitting time limit Most likely, your solution is actually O(N*M), because the statement says "It is guaranteed that the total number of wishes does not exceed 2 · M." I believe the time complexity is actually O(M*(N+M)). | | WA4 | andreyDagger`~ | 2173. Meta-statement 3 | 24 Jan 2024 08:03 | 2 | WA4 andreyDagger`~ 28 Jul 2023 21:08 Pay attention to: "wants to see the name of their company in the exactly s_i DIFFERENT problem statements" |
|
|
|