We are excited to invite you to Mirror BNPC-HS 2022 Final Round (Unrated) on Sunday, November 6th 2022, 11:05 UTC+7
The contest will be 5 hours long and will feature 10 problems. The order of the problems is the same as the original BNPC-HS contest.
The problems were written by Owmicron, vioalbert, Yoshiyuki, kresna, and alwyn
Problem components were prepared by jfcjaya, Owmicron, vioalbert, rfpermen, trainerherp, tyroflex, Nich728, alwyn, keziaaurelia, notwatermango, siplusplus, VinsenN
We would also like to thank:
- prabowo and fushar for their help in hosting the mirror contest;
- KerakTelor for supervising the Scientific Committee;
- Zanite, yz_, CyberSleeper, steven.novaryo, VincentGunardi, kyonrevens, Chrisedyong, TypeYippie, SirVin, ArgoCahaya, and takeonicky for testing the problemset and providing invaluable feedback; and
- Every BNPC-HS committee member, administrator, and manager.
Special thanks to COMPFEST for providing the floor tiles.
BNPC-HS (Bina Nusantara Programming Contest for High School Students) is an annual competitive programming competition hosted by Binus University as part of BeeFest, a national-level competition for high school students. This contest is mirrored from the Final Round of BNPC-HS 2022 and is open for everyone to join (not limited to high school students)
We have put great effort into preparing this contest, and we truly hope that you will enjoy it. See you in the contest!
UPD: contest is over!
Congratulations to our top 5:
You can upsolve the problems here. The editorial is available here.
Thank you for participating, see you next year!
So excited on this round, last bnpchs final problems are good
Don't worry guys, this time we won't forget about the editorial!
(right?)
UPD: We didn't! Enjoy the editorial!
is it rated?
Answered in Task Description (Explicitly or Implicitly)
Bump! Contest is starting in less than 1 hour. GLHF!
starting soon!
How to solve F,H?
BTW was there an issue with spaces in input of J? Got RTE on test 47 :(
Hello, I'm the author of problem H. Thank you for participating in the mirror contest!
First of all, the editorial is up in TLX. We provide the editorial in both English and Indonesian.
Problem H was intended to be solved using Priority Queue (similar to Dijkstra). An easier version of this problem is when the tree is a line graph, and the problem is to find $$$K$$$-th smallest sum of the elements in subarray. However, this solution will not work in the tree version because some of the pairs of nodes are counted two times.
One of the first important lemma is that the $$$K$$$-th smallest simple path of all unordered pair nodes is equivalent to the $$$2K$$$-th smallest simple path of all ordered pairs of nodes. This version will work, because now all pairs of nodes are counted exactly two times.
Now, in the ordered pairs version, we can use the solution of the line graph version. It is like multi-source Dijkstra, where each node might be the root of the tree. Unfortunately, this solution might have $$$O(N^2)$$$ elements pushed to the Priority Queue.
A solution is to sort the adjacency list by the weight, and introduce the next nodes one by one. One of the tester said that it is similar to how Left Child Right Sibling works. Now, there are $$$O(N)$$$ (or at most $$$2N$$$) elements in the Priority Queue, which will solve this problem in $$$O(K_{max} \log N)$$$.
There might be a solution using Binary Search the Answer (or Parallel Binary Search for the query version) and Centroid Decomposition with some pruning. We are unsure whether it will pass the time limit. As it is out of the competition syllabus, and it is also an overkill solution, we did not implement this solution. Until now, there has been no one who solve this problem with this approach.
Hi, thanks for participating!
Regarding problem J, there was a spacing issue in the input near the first line of $$$U_i, V_i$$$ for test cases numbered $$$\geq$$$ 47. None of us caught this as everyone either used C++ or was too slow to solve J during testing.
We'll fix the test cases soon. For now, you can try using an input method that doesn't treat regular whitespace and endlines differently. We're really sorry for the inconvenience.
Thank you for pointing out the problem!
Happy to help :))
Despite the minor hiccup, I liked the problems. Also, thanks for the editorial.
Hi, I am the author of problem F. The editorial is available in TLX, but I'll try to explain from a different perspective.
We will always greedily try to take the leftmost $$$l$$$ where $$$A_l > 0$$$ and rightmost $$$r$$$ that still satisfies the condition of the operation. However, it's too slow to simulate the process naively.
Observation 1: Denote $$$op(l)$$$ as an operation where $$$l$$$ is the leftmost positive index. Assume that the right index $$$r$$$ is chosen optimally for $$$op(l)$$$. For every leftmost $$$l$$$ where $$$A_l > 0$$$, we will apply $$$op(l)$$$ at least $$$A_l$$$ times.
Observation 2: For any operation $$$op(l)$$$, if $$$A_l \leq A_{l+1}$$$, then the value of $$$A_{l+1}$$$ will decrease by $$$A_l$$$.
Observation 3: For any operation $$$op(l)$$$, if $$$A_l > A_{l+1}$$$, then after $$$A_{l+1}$$$ becomes $$$0$$$ in the process, $$$A_{l+1}$$$ will become $$$1$$$ after every 2 operations. Example case for clarity:
We can conclude that after $$$A_{l+1}$$$ becomes $$$0$$$, it will become $$$1$$$ for $$$\left\lceil {\frac{A_l - A_{l+1}} {2}} \right\rceil$$$ more times.
Let $$$f(i)$$$ be the number of times the value in index $$$i$$$ decrease. Notice that $$$f(i) \geq A_i$$$ and $$$f(i)$$$ is affected only by $$$f(i-1)$$$. Also, note that the value of $$$f(0)$$$ is $$$0$$$.
Let $$$ans$$$ be the total number of times we perform the operations. Then, for every $$$i < N$$$ it holds that:
We hope that you enjoy the problemset!
Auto comment: topic has been updated by rfpermen (previous revision, new revision, compare).