### RubenAshughyan's blog

By RubenAshughyan, history, 3 weeks ago, ,

This blog is to discuss the problems of Northwestern Russia Regional Contest round 2019 held on October 26.

• +26

 » 3 weeks ago, # |   +8 Any mirror where we can submit problems?
 » 3 weeks ago, # |   +3 L? How to solve faster than O(N*(logN)^3). We found solution with suffix automat, heavy-light and convex hull :'(.And D pleaseThanks in andvance!
•  » » 3 weeks ago, # ^ | ← Rev. 2 →   0 Can you please explain your approach using suffix automat, heavy-light and convex hull? We tried something similar with suffix tree, centroid decomposition and FFT but didn't succeed. Thanks in advance!
•  » » » 9 days ago, # ^ | ← Rev. 2 →   +16 Our solution uson suffix automaton was as follows:For the solution, you can argue that you want to get a balance between a small period and a big length. Take each node in the suffix automaton, and its endpos set $S$. The smallest period that you can obtain is the smallest difference between two elements in $S$ (try to prove to yourself why that is). You can compute the smallest period for each node in $O(n \log^2{n})$ using min-max merge of suffix link tree. Then you just update a global maximum with $(len(node) + mind(node))/ mind(node)$.
•  » » 7 days ago, # ^ | ← Rev. 2 →   +30 Problem D:Firstly, we ignore some redundant strings, and we define $R(n)$ equals to the number of palindrome or concatenation of two palindromes. We can iterate the length of first palindrome (length maybe 0), and $R(n)=\sum_{i=0}^{n-1} k^{\lceil \frac{i}{2} \rceil} k^{\lceil \frac{n-i}{2} \rceil }$.But some strings may be calculated multi times, like $abaaba$. We can assume that it is a palindrom or the concatenation of $aba$. There is concolusion that a palindrome has two or more concatenation plans if and only if the palindrome $s$ has a period $p$ ($\forall i+p<|s|, s[i]=s[i+p]$) and $|s|$ can be divided by $p$. The number of plans is $|s|/p$ ($p$ is the period with minimum length of $s$).So, we define $D(n)$ equals to the number of palindroms or strings that have only one kind of concatenation plan like $caba$. We need to substract the number of extra strings. With the concolusion above, we only need to iterate all the factors $l$ of $n$(except $n$ itself), and $D(n)=R(n)-\sum_{l|n \land l  » 12 days ago, # | 0 For B, we took such$x$that$\sin x_{i+1} < \sin x_i$and$\sin x_i - \sin x_{i+1} < \epsilon$where$\epsilon = 9 \times 10^{-5}$(we chose it by trial and error :p). This seemed to generate$50000x$in$[0, 4 \times 10^7]\$.
•  » » 9 days ago, # ^ |   -18 And it's essential to select initial integer x that gives maximum value like -11
•  » » 9 days ago, # ^ |   0 https://paste.ubuntu.com/p/KTd8tqGH2C/ Your solution is right and you can accelerate the calculation by preparing a list like this.For n <= 8200 you don't have to calculate them.
 » 12 days ago, # |   0 Also, the editorial is here in Russian: https://neerc.ifmo.ru/archive/2019/northern/nwrrc-2019-tutorials.pdf Any English version? I am having hard time reading F. :3
 » 8 days ago, # | ← Rev. 2 →   0 anybody can help me !!!!i don't know how to solve e,thx!
•  » » 8 days ago, # ^ |   0 The node you are looking for will be always on the center of the path between any team city and the fartest node from that team city. If that node doesn't satisfy the condition, then the answer is NO