| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 147 |
| 3 | Proof_by_QED | 147 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 142 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
|
0
There are many ways to solve this problem but your solution is concise. I solved it using dfs. |
|
+2
Check for this test case 5 4 5 1 2 2 3 3 1 4 3 Correct Output: 1 |
|
0
I have updated the first statement. Note that any power of 2 will be even and any power of 3 will be odd, hence (power of 2) can not be equal to (power of 3). |
|
0
Auto comment: topic has been updated by aMitkvikram (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by aMitkvikram (previous revision, new revision, compare). |
|
0
There is only one connected component in the graph.We are searching for component which itself is cycle. Here we see that 1-2-3-4 and 4-5-6 are two cycles in component but component itself is not a cycle so answer is 0 not 2.
|
|
+1
I made some changes in your code. In bool DFS(int idx, int cnt) function you were not checking if idx can be last vertex of sequence, and in the end of same function you should return false. Corrected Solution change at line no. 43 and 58. |
|
0
If we could prove that every vertex has at most one child. For explanation please refer: 977D expanation. |
|
0
Read this one once:977D It's okay to not understand everything in beginning. |
|
+1
Yup, For Explanation: http://mirror.codeforces.com/blog/aMitkvikram |
|
0
Auto comment: topic has been updated by aMitkvikram (previous revision, new revision, compare). |
| Название |
|---|


