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

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

We will hold UNIQUE VISION Programming Contest 2024 Christmas (AtCoder Beginner Contest 385).

We are looking forward to your participation!

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

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

AtCoder try not to make multiple problems with the same theme just bigger constraints challenge: IMPOSSIBLE

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

Why set the precision of F to 10^-9, even though its solution is real number binary search? It is quite annoying to deal with precision issue.

Edit: the official solution is not real number binary search.

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

does solution of $$$F$$$ contain some elements of geometric right angle triangle calculation?Yes or No?

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

HELP — Can anybody help with this solution of D,it fails 3 testcases for some reason.

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

For problem G. I got this dp

for(int i=1;i<=n-2;i++){
    for(int j=i;j>=1;j--){
        dp[j] += dp[j-1] * i;
    }
}

Which is the coefficients of this polynomial $$$(x+1)(x+2)(x+3)...(x+n)$$$ which is equal the stirling numbers of first kind, but failed to get this is $$$O(n)$$$ or $$$O(n log n)$$$, only thought about an $$$O(n log^2 n)$$$ fft solution but didn't even code it.

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

I wasted 40min because I wrote 'continue' as 'break'.

:(

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

Why doesn't binary search work for F? Is it because the required precision is not achievable under the given constraints for the iterations of the binary search?

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

Can anyone help as to why my submission for F is failing on 1 test case and I'm unable to decipher what is wrong with it. my submission

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

For problem F, why do i set the upper bound of binary search 2e18 WA but 1LL<<60 accept??? code 2e18 code 1LL<<60

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

How to solve problem F?

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

How can I solve problem F? I use a binary search to find out the answer, but it got wa. I think my precision of my answer has been hacked, but I can't fix it. So can anyone help me?

Sorry for my poor English.

Here is my code.

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

D>>F>E

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

The difficulty of F is centred on the consideration of the boundary case, and the precision.

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

Please don't set such high precision requirements! Is there a difference between 1e-6 and 1e-9? A lot of people find the right solution but can't break the limits of floating-point accuracy. Such a high precision requirement is difficult to meet and does not improve the "mental difficulty" of the problem, so it is meaningless. (Sorry for the bad translation software.)

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

I think there are some major issues in Problem $$$F$$$. Kindly check this submission.

We can observe the following:

  1. If the line segment touches the the top of building $$$A$$$ then the top of building $$$B$$$, $$$B$$$ is considered not visible for the initial condition ($$$H = 0$$$), and considered visible elsewhere (notice the 2nd arg in the 2 invocations of the function '$$$can$$$', changing that arg in any of the invocations gives wrong answer).
  2. Changing the binary search upper bound to other limit like $$$1e18L$$$ or $$$2e18L$$$ gives wrong answer. It seems working only with the written limit (which is equivalent to $$$1LL$$$ << $$$60$$$) and some values around it, as if the test cases were hand-crafted on such limit, which is incorrect testing approach.
  • »
    »
    20 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    The first one is correct behavior according to the definition in the problem

    From a point P with coordinate x and height h, building i is considered visible if there exists a point Q on building i such that the line segment PQ does not intersect with any other building.

    For the second one, I guess it would work as long as $$$L = 0, R = 2^k$$$ for big enough $$$k$$$? Not sure how to estimate the error but it feel reasonable to have less error when $$$R$$$ is power of $$$2$$$ since computer store everything in binary. I also trapped on this one, guess it's a lesson to learn :P

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

      For the $$$1^{st}$$$ point, what if the line touches the top point of some intermediary building first before reaching the final building? The tests show that in this case, whether the final building will be considered visible or not, is different between $$$H=0$$$ and $$$H \gt 0$$$, which is a contradiction. Kindly check the boolean arg 'isEqualVisible' in the submission in my previous comment.

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

        Let $$$x$$$ be the smallest real number s.t. there are at least two building intersect with the line, then the range of real number to be able to see all building is $$$(x, \infty)$$$. When $$$x \ge 0$$$, output $$$x$$$ is consider correct just because it have arbitrarily small relative error to the correct answer rather than it's visible on $$$x$$$, and when $$$x \lt 0$$$, $$$0$$$ is visible and the problem ask you to output $$$-1$$$ in such case.

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

          For this part "and for $$$x=0$$$, $$$x$$$ is still invisible and the problem ask you to output $$$−1$$$ in such case", I think you meant we are asked to output $$$-1$$$ if the buildings are visible with $$$x = 0$$$.

          Considering this submission, the only difference between it and the other one is that now I am passing $$$false$$$ at line $$$50$$$. The impact this change will make is that the checking function '$$$can()$$$' will consider a building as invisible if its slope is equal to the slope of the building before it, which is the case we are discussing (this is done with the help of the function $$$eq()$$$, which considers the difference absolute value for more accurate equality between floating point values). We are getting 'Wrong answer' with this. Even if this is due to deep precision aspects, I believe it is very confusing.

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

Oh this is a fun contest,but I think D is kinda complicated so that I waste much time on it

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

Why am I getting wrong answer if I use binary search in E problem as if we can see from H height, then we can see from all heights greater than that?

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

Why problem F could be solved with a monotone stack?