| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3657 |
| 3 | jiangly | 3638 |
| 4 | turmax | 3442 |
| 5 | tourist | 3380 |
| 6 | Um_nik | 3353 |
| 7 | strapple | 3350 |
| 8 | squareOf105 | 3346 |
| 9 | heuristica | 3322 |
| 10 | maroonrk | 3310 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | AmShZ | 144 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | adamant | 137 |
| 8 | BledDest | 135 |
| 9 | maroonrk | 133 |
| 10 | qwexd | 130 |
|
0
Well, the problem is here : ``` void dfs(int x,int y){ vis[x][y]=true; if(valid(x-1,y))dfs(x-1, y); else if (valid(x,y+1))dfs(x , y+1); else if(valid(x,y-1))dfs(x , y-1); else if(valid(x+1,y))dfs(x+1, y); } Hovewer sometimes the $$$"."$$$ cell can be in more than one "$$$direction$$$". The correct way to write it for |
|
0
Your are right, in order to use x in the $$$[1, n / 2]$$$ we need to check $$$2x,3x..$$$ as well, but instead of checking $$$x,2x,3x...$$$ we just need a maximum $$$yx$$$ such that $$$yx \lt = n$$$, and if we mark that $$$yx$$$ then every number $$$x,2x,3x,4x.. \lt yx$$$ will be changeable because $$$u$$$ $$$mod$$$ $$$p$$$ $$$!=$$$ $$$0$$$ when $$$u \lt p$$$. That's why my solution uses number $$$[n/2+1, n]$$$ because there is $$$NOT$$$ any number $$$x$$$ in that range such that $$$2x \lt = n$$$. |
|
+17
For problem $$$C$$$ it's just enough to check if any of the chars beetwen $$$[n/2+1, n]$$$ (1-indexing) is equal to $$$c$$$ , if it's then the answer is 1. $$$Proof$$$ : Any number between $$$[1, x - 1]$$$ and $$$[x+1, x*2-1]$$$ isn't divisible by x, so every index that isn't $$$x$$$ ,will be changeable. Time complexity — $$$O(N)$$$. My submission — 131189321. Btw, nice contest, thank u! |
|
0
Yeah.. that's true no one can say that the pretests were good. |
|
0
Actually your solution was totally wrong with this line $$$if(a[i]-i \gt 0)$$$. |
| Name |
|---|


