hliu1alt's blog

By hliu1alt, history, 17 months ago, In English

Hi, I'm wondering if the problem statements on Yukicoder are ever translated into English. I'd like to upsolve some of the problems from there, or maybe participate in live contest if they have translations. I could not find any with a brief search. If not, that's okay! Thanks :)

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it

By hliu1alt, history, 20 months ago, In English

I think most of us would agree that seeing the tags before solving a problem often spoils it.

By default, CodeForces shows all tags and difficulty ratings next to every problem before you even click into it. Also, on the statement page itself, the tags and difficulty are shown on the side.

This makes it so that when I link a problem to my friends who happen to not be signed in, or maybe even don't have a CF account (I just want to show them the problem statement because I think it is interesting), then they see the tags right away.

Even if you are signed in, by default the tags still show. You need to go into your account settings to toggle them off. Many new users may not be aware of this feature.

I think the ideal functionality would be to hide the tags and rating by default, then have one spoiler button which reveals the tags and one spoiler button which reveals the difficulty, regardless of whether or not you are signed in.

There are a number of browser extensions which improve this experience a lot, but again, the problem is primarily not for dedicated CF users who would have these extensions. I think if this default behavior was changed, many users would appreciate the quality of life upgrade and it would be a lot easier to send problems around to my friends.

That being said, I have no idea how difficult this is to implement. If it's not feasible for any reason, that's understandable. Thanks for hearing this request out anyway :)

Full text and comments »

  • Vote: I like it
  • +14
  • Vote: I do not like it

By hliu1alt, history, 21 month(s) ago, In English

I am working on a problem which I believe I have reduced to the following. I know that there's a better solution to this problem but I wanted to see if there's any interesting solution to find in this direction.

I have the following matrix

A = 
[
 1  1  1  1  1 ... 
 1  2  3  4  5 ...
 1  3  6 10 15 ...
 1  4 10 20 35 ...
 1  5 15 35 70 ...
 ...
]

Notice that A[i][j] = A[i-1][j] + A[i][j-1] and that the diagonals form binomial coefficient patterns.

I want to evaluate the following function in better than O(n) time.

f(i,n,x) = (A[i][0] * x + A[i][1] * x^2 + A[i][2] * x^3 + ... + A[i][n] * x^n) % bigPrime

If it helps, there are a fixed, very small, number of values of x for which I will ever need to evaluate this at.

For example, say x is only ever in {1, 2, 3}.

Is this possible?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By hliu1alt, history, 3 years ago, In English

I've been trying to use the ACL lazy segtree (source code here) to solve the following CSES problem.

Is it possible through purely the template API? Or do I need to modify the internal implementation a bit. If it is possible, can anyone provide some hints on what values I need to be storing in S and what I need to pass around in F?

Thanks in advance!

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it