Geanina_the_Great's blog

By Geanina_the_Great, history, 12 months ago, In English

Hello, codeforces!

Do y'all like my profile picture? I personally think it perfectly encapsulates this platform's ideals and values and it also aligns with my beliefs. Moreover, it really does a world of good to my mental health, so there is that.

Anyways, I have this really cool problem: You are given a string S of digits separated by the following operators: +, , -, /, ^(pow), $$$(xor), &, |, (, ). Parentheses have biggest priority, then: '^'(pow) > '/' > " > '+' > '-' > '&' > '|' > '$$$'(xor). The task is to find out in how many ways modulo 10^9 + 7 you can rearrange the characters of the string such that the result is a given X(X < 10). |S| <= 2 * 10 ^ 5. Time limit: 0.01 seconds Memory limit: common sense.

Happy Christmas to all my christian fellas!

Yours truly, Geanina

  • Vote: I like it
  • -32
  • Vote: I do not like it

»
12 months ago, # |
Rev. 3   Vote: I like it +30 Vote: I do not like it

My brother in christ, the solution is very simple: take FFT of input strin g, build segmented tree on output, then problem is equivalent to dijkstra inverse modulo 998343447.

This is trivial to do with mo's algorityhm. Final complexity: $$$O(\sqrt{log(n)⋅mi} + q^3)$$$ , where n = number of string, m = sprague-grundy number of string, i = imaginary number, q = number of times you asked this question. Hope it helps!1@!@@1!!!!

by the way, very nice profile picture, but does not have enough rizz and gyatt. 4/10

»
12 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Umm no offense, but this helps your mental health?

»
12 months ago, # |
  Vote: I like it 0 Vote: I do not like it

yeah, as if everyone would agree that a amongus with feet bigger than its head as a profile picture that by your words, "perfectly encapsulates this platform's ideals and values"