In the recent Div 3, I was rushing to submit fast to reduce the penalty so I miss-typed this part of the code:
if (j + tochange[i])
dp[i + 1][j + tochange[i]] = dp[i + 1][j + tochange[i]] | dp[i][j];
It should be:
if (j + tochange[i] <= n)
dp[i + 1][j + tochange[i]] = dp[i + 1][j + tochange[i]] | dp[i][j];
Can you hack my submission, please?: 203309510
Update:
Solution verdict: Wrong answer
Congratulations Yousef-Elwan!
But why my solution didn't get RTE?
It seems I'm the only person who solved it like this (with DP). So, now I'm unsure about my idea and don't have firm proof.
You can go ahead and try hacking with wrong answers as well.
Could you explain your idea,please?
I need to choose some letters that are the same on both sides with other letters that are the same as well so we fix two in just one operation (greedily).
So I need to choose some of these letters that their count is the closest to (total / 2).
Example:
We notice that the letters the need to be fixed are:
After one operation:
That last one can be fixed in one operation.
You can solve this DP problem first to understand the idea: https://cses.fi/problemset/task/1093.
The flaw here is that, I either take all of "a" for example and swap them with others or leave them all.
Wow you're the guy from fegla senior training
I think it's a wrong idea, not only that it crossed n