Блог пользователя tril0713

Автор tril0713, 6 недель назад, По-английски

We call a string $$$s$$$ of length $$$n$$$ good, if and only if $$$n \bmod 2 = 0$$$ and $$$s[1,\dfrac{n}{2}] = s[\dfrac{n}{2}+1,n]$$$ (i.e. there exists a string $$$t$$$ that $$$s = t + t$$$.)

You are given a string $$$s$$$. For each $$$r \in [1,n]$$$:

  • Find all good substrings ending at position $$$r$$$.
  • The guess is: Their length can be divided into $$$\mathcal O(\log n)$$$ consecutive intervals.

Is the guess correct?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится

Автор tril0713, история, 4 месяца назад, По-английски
Problem statement

We transform the condition $$$s_i \ne s_{n-i+1}$$$ into if we change all $$$\texttt{0} \to \texttt{1},\texttt{1} \to \texttt{0}$$$ and reverse it to get a string $$$t$$$, $$$s$$$ is good if and only if $$$s = t$$$. Then we can use suffix array or manachar to get the answer.

Then, the hash solution did the same transformation and use hashing to get the answer with $$$\text{base} = 10^9+7$$$ and $$$\text{mod} = 2^{64}-1$$$ (unsigned long long). Can it be hacked? I have done stress test for $$$15000$$$ test cases :(

I will provide the hash code and the suffix array code below, if you need to make a stress test.

SA code
hash code

Полный текст и комментарии »

  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится

Автор tril0713, история, 5 месяцев назад, По-английски

Is there any extension which can change the submissions status such as changing Wrong answer on test X to Wonderful answer on test X? If it exists where can I find it?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится