Here is a Problem: 2069B - Set of Strangers Here is Soln: 306760751
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | jiangly | 3670 |
| 3 | Kevin114514 | 3657 |
| 4 | maroonrk | 3355 |
| 5 | Um_nik | 3353 |
| 6 | squareOf105 | 3346 |
| 7 | tourist | 3343 |
| 8 | strapple | 3324 |
| 9 | heuristica | 3322 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | AmShZ | 143 |
| 4 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | adamant | 137 |
| 8 | BledDest | 134 |
| 9 | maroonrk | 133 |
| 10 | qwexd | 130 |
Here is a Problem: 2069B - Set of Strangers Here is Soln: 306760751
| Name |
|---|



Bro tune third question 2069C - Красивая последовательность,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]