| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | Kevin114514 | 3678 |
| 3 | VivaciousAubergine | 3647 |
| 4 | jiangly | 3582 |
| 5 | strapple | 3515 |
| 6 | tourist | 3473 |
| 7 | Radewoosh | 3418 |
| 8 | Um_nik | 3376 |
| 9 | maroonrk | 3361 |
| 10 | turmax | 3345 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 162 |
| 2 | adamant | 148 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 143 |
| 5 | errorgorn | 141 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 133 |
|
0
Sure, observe that parity of initial index and final index should remain same as i <-> i+2. But there can be duplicates, so for all values the number of odd/even indices in initial array must be equal to number of odd/even indices in the final sorted array. |
|
+9
We have a solution which we believe is correct but we were getting WA. Apply meet in the middle. Divide the people into two groups Overall complexity: $$$(O(T*(3^{10} * 2^{10})) = O(T*(6^{10}))$$$ The total number of operations are roughly $$$6e8$$$ and 4 sec is a little strict but it should pass. |
|
+74
okwedook test cases for E are weak. Many $$$O(N^2)$$$ have been passed. So please consider rejudging all submissions. |
|
+27
A much simpler approach : Let $$$dp(N,K)$$$ be the number of multi sets with sum $$$k$$$ and size $$$N$$$ . You can recursively formulate $$$ dp(N,K) = dp(N,2*K) + dp(N-1,K-1) $$$.The first term $$$dp(N,2*K)$$$ is the case when you don't take 1 and so the sequence starts from $$$\frac{1}{2}$$$ so it is equivalent of taking sum to $$$ 2*k$$$ and let the sequence to start from 1,The other term ,$$$ dp(N-1,K-1) $$$ is the case when you have taken 1 in the multiset,so your sum reduces to $$$k-1$$$ and length to $$$N-1$$$ and you can still start from 1. |
|
+8
How to solve E ? |
|
0
how to find the coefficient of x^N in that product.I also arrived at this point. |
|
0
Using min-cost max-flow, take n nodes to the left side ( represents books), m nodes to the right side ( represents algorithms), connect a source to all the n nodes in the left with capacity = total understanding it provides for all algorithms, and cost = cost of the ith book. connect sink with all the m nodes to the right with capacity x and cost 0, also for all the n nodes in the left, connect to each of the m nodes with a capacity equal to a[i][j] and cost 0. Now perform min cost maxflow algorithm and for the maximum flow calculate the minimum cost, if the maximum flow is not equal to m*x, then the answer is -1.(maximum flow cannot be greater than m*x since the capacity of all the edges to sink is x). |
|
+3
For F: let's say some blocks have been placed giving total sum ( by total sum, I mean number of '(' minus number of ')' ), equal to prev. Now for all the blocks left, which have a minimum value of prefix sum greater than or equal to prev , select a block having a maximum total sum.This can be done by using binary search and seg-tree. Is it wrong ? since I am getting WA verdict , not sure if the implementation is wrong or the logic is wrong. |
|
0
any hints for C ? |
| Name |
|---|


