Here is a Problem: 2069B - Set of Strangers Here is Soln: 306760751
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3857 |
| 2 | jiangly | 3810 |
| 3 | maroonrk | 3534 |
| 4 | tourist | 3528 |
| 5 | Kevin114514 | 3510 |
| 6 | turmax | 3411 |
| 7 | Um_nik | 3387 |
| 8 | Radewoosh | 3367 |
| 9 | heuristica | 3322 |
| 10 | strapple | 3317 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | maspy | 150 |
| 3 | Um_nik | 145 |
| 4 | Errichto | 139 |
| 5 | adamant | 136 |
| 6 | maroonrk | 134 |
| 7 | nik_exists | 133 |
| 7 | DNR | 133 |
| 9 | AmShZ | 130 |
| 10 | Dominater069 | 129 |
Here is a Problem: 2069B - Set of Strangers Here is Soln: 306760751
| Name |
|---|



Bro tune third question 2069C - Beautiful Sequence,dp ka implementation kaise kiya hai yeh bata sakta hai , like approach mujhe bhi aagayi thi but i don't know how to implement it
good subsequences are of form 12222....3. count of 2s >= 1 and start me 1 and end me 3.
// dp[i][1] bolega no of subsequences of form "1" till i // dp[i][2] bolega no of subsequences of form "122...." till i // dp[i][3] bolega no of subsequences of form "12....3" till i
// dp[i][1] ,agar a[i] == 1, dp[i][1] = 1 + dp[i-1][1], nhi toh base dp[i][1] = dp[i-1][1]
// dp[i][2], agar a[i] != 2 toh dp[i][2] = dp[i-1][2] // but if a[i] == 2 // i-1 tak jo already 12... bangayi ume 2 jod de, ya mat jod. total 2 * dp[i-1][2] hojayengi // i-1 tak jo no of form "1" ki subsequences hai unme 2 jod de, toh dp[i — 1][1] // so dp[i][2] = dp[i — 1][1] + 2 * dp[i — 1][2]
//dp[i][3], i-1 tak jo already 12.... bangayi unme 3 jod de bas, dp[i][3] = dp[i-1][2]