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

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

We will hold Daiwa Securities Co. Ltd. Programming Contest 2024(AtCoder Beginner Contest 383).

We are looking forward to your participation!

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

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

Hope the problem G is easier than last two ABC.

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

I wish every could have a fantastic experience at this anticipating contest!

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

what even D?

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

E harder than F

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

How G? I had some ideas using aliens trick, but I was still no where close to solution.

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

Can anyone explain E?

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

So, you set this kind of D, what are you gonna do for ABC next time?

  • A. count numbers with 3 divisors (n<=100)
  • B. count numbers with 5 divisors (n<=100)
  • C. count numbers with 8 divisors (n<=10000)
  • D. count numbers with 13 divisors (n<=10000)
  • E. count numbers with 4 divisors (n<=1000000)
  • F. count numbers with 7 divisors (n<=1000000000)
  • G. count numbers with 5 divisors (n<=1000000000000)

huh??????????????????????????????????????????????????????

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

For D, my solution WA*29. For Sample2 4000000000000, my code output 407097 while the correct answer is 407073. Why?

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

My Idea for the problem E and F:

E:- Topic — Sorting, DSU || For each node, we will maintain whether the node belongs to arr1 or arr2. We have maintained it using cnt1 and cnt2 variables in DSU. First, sort the edges in ascending order. Then connect the edge one by one and during each Union Operation, We can connect the path from arr1 to arr2 using min(cnt1[node1],cnt2[node2]) or from arr2 to arr1 using min(cnt2[node1],cnt1[node2]). The cost will be no. of operations multiplied by edge weight in current Union. https://atcoder.jp/contests/abc383/submissions/60536697

F:- Topic — Knapsack DP, Sorting || The problem is simple Knapsack, the only catch is how to maintain the number of distinct colors. Suppose the number of distinct colors is X, then we can add K(given constant) by X times. We can sort the items by the colors so that we can check if the next item is of same color or not. We can maintain binary parameter in DP to check if we are taking current color first time or not. https://atcoder.jp/contests/abc383/submissions/60546303

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

In E, we can find lengths using dijikstra but how would we pair A,B??. One way can be sorting lengths of each pair (Ai,Bi), but that would be k^2.

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

    You can sort edges based on the weight. As the cost is defined as max weight of the edges on the path, you can add them 1 by 1. When A and B become connected through new edge, it means $$$dist(A, B) = w_{edge}$$$.

    Then it's the greedy idea: if you can pair A, B with a minimal cost of the set, you should do it. Otherwise, the cost would be worse. Consider freshly connected A, B and still not connected C, D. If you don't connect (A, B) now and consider (A, C) + (B, D) was more optimal, that you'll wait until C is connected to the (A, B) component and D is connected with (A, B) component as well. At that moment (C, D) is in the same component too (but maybe they were connected even earlier). Then the 2 holds: $$$cost(A, B) \le cost(A, C)$$$ and $$$cost(C, D) \le cost(B, D)$$$.

    So, $$$cost(A, B) + cost(C, D) \le cost(A, C) + cost(B, D)$$$. And it is better to pair them greedily. Not sure this is a strict proof, but seems strict enough

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

can we calculate efficiently next DP:

dp[i][j] = max{0 <= k <= j}(dp[i-1][k] + a[i][j-k])

It's some kind of convulsion but I don't understand how to calculate it.

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

Can someone help me with this D solutionIt fails one testcases and i am not able to debug it.

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

https://codeforces.me/contest/265/problem/E interesting problem similar to F but slightly different