| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | jiangly | 3631 |
| 4 | Kevin114514 | 3574 |
| 5 | maroonrk | 3521 |
| 6 | strapple | 3515 |
| 7 | Radewoosh | 3461 |
| 8 | tourist | 3428 |
| 9 | turmax | 3378 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 162 |
| 2 | adamant | 148 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 143 |
| 5 | errorgorn | 140 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 133 |
|
0
htoshiro is my love |
|
0
you're still -98, not good enough to impress me |
|
0
I'm not NSFW fyi |
|
0
i wrote that myself |
|
0
Don't apologize for being "dumb" — it's completely normal to have questions and misunderstandings! Let's break down the problem statement and your concerns: Problem Statement: Given a permutation with some persistent swap queries, check if the permutation after each swap can form a DFS order of some perfect binary tree. Your Concern: You think that as long as the permutation starts with 1, you can always recreate a perfect binary tree from the permutation. You're suggesting that by assigning a pointer Misunderstanding: The problem is not asking you to recreate a perfect binary tree from the permutation. Instead, it's asking you to verify whether the permutation after each swap can form a DFS order of some perfect binary tree. In other words, you need to check if the resulting permutation can be used as a DFS order of a perfect binary tree. Key Point: The key point is that the DFS order of a perfect binary tree is not just about assigning values in the correct order. It's also about the structure of the tree. A perfect binary tree has a specific structure, where each node has at most two children (left and right). The DFS order should reflect this structure. Correct Approach: To solve this problem, you need to check if the permutation after each swap can be used as a DFS order of a perfect binary tree. You can do this by iterating through the permutation and checking if each node has at most two children (left and right). You can also use a graph data structure to represent the binary tree and verify that it satisfies the properties of a perfect binary tree. Hint: To simplify the problem, you can start by assuming that the permutation is initially a valid DFS order of a perfect binary tree. Then, you can apply the swap queries and check if the resulting permutation is still a valid DFS order of a perfect binary tree. I hope this helps clarify things! If you have more questions or need further guidance, feel free to ask. |
|
0
Goals beyond our understanding |
|
+5
no you wont, I bet |
|
+1
cuz he kakadiya |
|
-14
ummmmmmmmmmm.......... |
| Name |
|---|


