Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

atcoder_official's blog

By atcoder_official, history, 4 weeks ago, In English

We will hold AtCoder Regular Contest++ 232. Note that it's on Saturday, not Sunday.

We are looking forward to your participation!

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

»
4 weeks ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Could you please tell me whether the blank "Date of birth" should be dd/mm/yyyy (e.g. 17/09/2010) or mm/dd/yyyy (e.g. 09/17/2010)? I don't know how to fill in that blank.

»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How come for A, a simple cycle detection spfa works, but not my spfa that tracks possible solutions for each location? Should not my spfa be much harder to hack?

  • »
    »
    4 weeks ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Could you explain, how SPFA helps here?

    • »
      »
      »
      4 weeks ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      The easy way to think about it is to represent as difference constraint problem. for some constraint x, y, prefix_sum[x] + 2 = prefix_sum[y] so we can bound using two inequalities. Also prefix_sum[i] <= prefix_sum[i+1] <= prefix_sum[i] + 1, so two more inequalities can be used. This solution somehow works even though there are trivial ways to hack it.

      My solution involves maintaining the lower and upper bound of each value just checking for contradiction in the range rather than cycle detection. This in theory makes it harder to hack, but I got tle with this.

      By thinking of both and choosing a better solution, I somehow got worse score than people who just thought of the first solution.

»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Many optimized spfa have passed A/fn/fn/fn

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Is $$$O(N^5)$$$ intended to pass for D? Decently fast submission, slower but more bruteforcey submission. It's just a simulation DP made more efficient by stuff like precomputing coefficients and skipping zero-transitions.