| # | User | Rating |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3447 |
| 6 | Um_nik | 3387 |
| 7 | heuristica | 3322 |
| 8 | turmax | 3317 |
| 9 | tourist | 3307 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 156 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 141 |
| 5 | Errichto | 139 |
| 6 | adamant | 137 |
| 7 | AmShZ | 136 |
| 8 | BledDest | 132 |
| 9 | maroonrk | 131 |
| 10 | qwexd | 129 |
|
0
How to solve D? My idea: So i was thinking we could have a map like structure to check existence of a particular sum like each node will also have a map where the mp[val] = i if there are i neighbours with value = val as an edge else 0(default). Then I thought of just keeping a queue/stack where I just push {sum,node,vis}. So Now it looks for the sum in the node's map and if found puts in the stack {sum+nodeval, new node, new vis} and increases answer by 1 and decreases the value of mp[sum] by 1. I feel like this could work but I couldnt implement in time. I feel like there should be a much neater way to solve this. |
|
0
I couldnt solve it during the contest. but this is what I was thinking: use w(a * b) = w(a) + w(b) — w(gcd(a, b)). sieving and saving the omega values before hand for upto 2*10^5. I found that 2*3*5*7*11*13*17*19 = 9699690 so all the values for numbers < 2*10^5 should be below 8. Which means 8c2 there are only 28 possible pairs so we pre-calculate w as well for all possible pairs The only thing I was stuck at is how to add this w^k for all i,j i<j without n^2. |
| Name |
|---|


