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

Автор atcoder_official, история, 2 года назад, По-английски

We will hold HUAWEI Programming Contest 2024(AtCoder Beginner Contest 342).

We are looking forward to your participation!

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

A round with prizes,NICE.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +29 Проголосовать: не нравится

HUAWEI Round. Excited.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +23 Проголосовать: не нравится

tourist register and he will get more money

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

omg HUAWEI round

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

omg this is the first time that I see a video in the contest description!

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

excited

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

F<<<E!!!

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится +61 Проголосовать: не нравится

    Really? I felt like E was just "yeah this is your standard ABC dijkstra problem, enjoy implementing for 10-15 mins :)" while F actually required some rough thinking.

    • »
      »
      »
      2 года назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      I observed that, but what's next?

      • »
        »
        »
        »
        2 года назад, скрыть # ^ |
         
        Проголосовать: нравится 0 Проголосовать: не нравится

        start with n-1 storing val-c in priority queue to next node where val=current node max value.

        code
  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    How did you do for F ?

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I think D was two pointer problem.Am i right?

»
2 года назад, скрыть # |
 
Проголосовать: нравится -16 Проголосовать: не нравится

G is easier that D :)

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

For F: I was able to find out the probability of achieving $$$x = x_0$$$ and the winning probability when $$$x = x_0$$$. Using this info, how do I determine the answer.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone provide me edge case for my solution for Problem D Link

Approach: Precompute all the squares till 2e5 and check by dividing that if good pair exists or not.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can someone explain F?

  • »
    »
    2 года назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +10 Проголосовать: не нравится

    First compute the probability that dealer gets at least $$$x$$$ points linearly. Then do dynamic programming over $$$dp[x]$$$ = probability that you win if you start with $$$x$$$ points.

    https://atcoder.jp/contests/abc342/submissions/50612581

  • »
    »
    2 года назад, скрыть # ^ |
    Rev. 8  
    Проголосовать: нравится +21 Проголосовать: не нравится

    For the dealer we can simulate the probabilities of them having a particular sum at the end since they have a fixed move for a given sum.

    Pseudocode

    Now for the player, if we stop at a specific score $$$x$$$, we know the probability of winning is $$$\text{player_probability[x]} = 1 - \sum_{i = x}^{n}{\text{dealer_probability[i]}}$$$. However, we can also decide to continue playing, in which case it becomes the average probability among all possible dice rolls, i.e, $$$\frac{\sum_{i = x + 1}^{\text{min(x + d, n)}}{\text{player_probability[i]}}}{d}$$$, so we take the max of these two values. Doing this in decreasing order of $$$x$$$ gives us a way to calculate the probability for all scores.

    Pseudocode

    Then player_probability[0] is the value you want. To speed this up from $$$O(n ^ 2)$$$ to $$$O(n)$$$, use difference arrays and prefix sums to get rid of the inner loops in both of the above parts.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

How are the rating updates for the ABC calculated if there are so many participants whose ratings are outside the rated range? I mean, they are still considered in the ranking list, aren't they? Wouldn't it be unfair to calculate the rating changes based on the rank each time, as sometimes there are stronger competitors?

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +6 Проголосовать: не нравится

Is it just me who overcomplicated the solution of problem C with small-to-large merging xD? Submission

»
2 года назад, скрыть # |
 
Проголосовать: нравится +32 Проголосовать: не нравится

90% of E is figuring out what the statement is trying to say 🤡

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

https://atcoder.jp/contests/abc342/submissions/50599311

can anyone tell me what is wrong in this code? Any help would be appreciated

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

btw in D if we factorize all numbers, we will know if the product of two num is squared, if only after adding their factors there is even numbers of factors right? 3 -> 3 and 12 -> 2,2,3 so 2,2,3,3

but how we can find all such pairs?

»
2 года назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

To help you build intuition for F and lead you to the solution in a more natural manner, I've created an easy version $$$O(n^3)$$$ and $$$O(n^2)$$$ which focuses on the probability + DP part (instead of optimization). It also asks you to print each intermediate DP values, since debugging probability problems can be tricky. I also added some followup problems to test your understanding.

You can find the contest here: https://mirror.codeforces.com/group/7Dn3ObOpau/contest/506759

The problems are untested. If you see any issues, please let me know.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

difficulty: G < E < F

I solved ABCDG(

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Admin please conduct contests on both Saturday and Sunday

»
2 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

The solution to G https://atcoder.jp/contests/abc342/submissions/50593706 is hacked by:
1
1
4
1 1 1 2
1 1 1 2
2 1
3 1

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

when the prize will be awarded :)