chokudai's blog

By chokudai, history, 3 days ago, In English

We will hold Panasonic Programming Contest 2022(AtCoder Beginner Contest 251).

The point values will be 100-200-300-400-500-500-600-600.

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

»
2 days ago, # |
  Vote: I like it +20 Vote: I do not like it

For problem D I represent number in 100-nary ($$$A_2 * 100^2 + A_1 * 100^1 + A_0 * 100^0$$$ for $$$0 \leq A_0, A_1, A_2 \leq 99$$$, and $$$10^6$$$ itself). Therefore we only need $$$3 * 99 + 1$$$ distinct numbers to represent all numbers within $$$10^6$$$.

  • »
    »
    2 days ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    Welp, I missed this T_T

    • »
      »
      »
      2 days ago, # ^ |
        Vote: I like it -21 Vote: I do not like it

      But u r 1720 rated on CF. It should have been straight-forward for u ig.

      • »
        »
        »
        »
        41 hour(s) ago, # ^ |
          Vote: I like it +6 Vote: I do not like it

        I'll learn from this and I promise to be a better 1720

  • »
    »
    2 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Please elaborate if you have time, I didn't got your approach.

    My questions : 1. What is this 100 nary number ?

    1. What are A1,A2,A3 ? Are they those three numbers which we are going to take ?

    2. and please explain this : we only need 3∗99+1 distinct numbers to represent all numbers within 10^6.

    Thanking you in advance

    • »
      »
      »
      2 days ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      Just regard each $$$i(1\le i\le w)$$$ as a $$$100$$$-base number. Then $$$A_0,A_1,A_2$$$ is each number of the $$$100$$$-base number. For example, $$$23456=2\times 10^4+34\times 10^2+56=(2,34,56)_{100}$$$, Then $$$A_0=56,A_1=34,A_2=2$$$.

      As for $$$100$$$, that's bacause $$$100\times 3=300$$$ and $$$100^3=10^6$$$.

    • »
      »
      »
      2 days ago, # ^ |
        Vote: I like it -17 Vote: I do not like it

      Jaikant shikre, asli id se aa

  • »
    »
    22 hours ago, # ^ |
      Vote: I like it -8 Vote: I do not like it

    But the third condition is — We can choose at most 3 different weights from the prepared weights with a total mass of n.

    If the chosen number is 15 then we can select 9,3,2,1 four different weights from the list. How is this correct?

»
2 days ago, # |
  Vote: I like it +8 Vote: I do not like it

Took 10 min to solve E as opposed to ~70 min for D. D > E

  • »
    »
    46 hours ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    yep E was straight up dp. how do they decide the ordering.

»
2 days ago, # |
  Vote: I like it +14 Vote: I do not like it

Thanks for the contest!! Problems were nice. (especially problems D and F)

»
2 days ago, # |
  Vote: I like it +8 Vote: I do not like it

Problem D is really an interesting problem,isn't it?

»
2 days ago, # |
  Vote: I like it +8 Vote: I do not like it

Thanks for problem B has a test with answer > max(w) :)) I spam problem B to guess the arrray :))

»
2 days ago, # |
  Vote: I like it +3 Vote: I do not like it

ABCs are becoming more and more challenging since the last 2 contests.

»
2 days ago, # |
  Vote: I like it 0 Vote: I do not like it

The second most difficult D that I participated at ABC (best one is ABC 210 D)

»
2 days ago, # |
  Vote: I like it +8 Vote: I do not like it

Problem D is somehow quite surprising! Thanks to the writers for providing such a nice problem. It gives me another way to think about the construction of integers. I think, in general, if the maximum integer has n digits, and we divide them into m groups, then the upper bound may be about m*10^(n/m). For this problem, n=6 and m=3 and this is how "300" comes out. It really took me a long time to find out this approach.

Problem E is about dp and F is about dfs/bfs, which is very nice as well. I am really lucky that at first sight, I have recogonized the correct solution, and I could seldom solve both E and F within the contest, but this time I made it.

»
2 days ago, # |
  Vote: I like it +8 Vote: I do not like it

For B, I think "at most 3" means: n can only be represented by the sum of <=3 weights. If it can be obtained from >=4 weights, it is not a good integer. Then i didn't solve it during the contest.

»
2 days ago, # |
  Vote: I like it 0 Vote: I do not like it

can anyone explain E?

»
46 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

E was very similar to recent contest — AtCoder Beginner 247 F

»
6 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

For problem G, I try to find the largest and smallest length of intercept (X or Y intercept whichever is smaller) of a particular side among all polygons. Then line passing through the query point (a, b) must have intercept not lying in the range [smallest, largest] and must lie in one of the polygon. Do this for all n sides.

The problem with this is intercept if stored as double lead to floating point issue, and if stored as a rational number will lead to overflow of long long. What can I do in this case? Some testcases are showing TLE too.

submission

I understood the japanese editorial given in atcoder, which is actually very nice and simple!