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

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

We will hold AtCoder Beginner Contest 338.

We are looking forward to your participation!

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

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

Hope to make ABCDE!

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

hope to make ABCDEF

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

ACed ABCF,but No DEG(

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

    ABCE here, no DFG :(

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

    how did you solve F if you couldn't solve E, xD

    E is like even easier than D i think

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

      I don't know()

      I ACed ABCF in 31 mins.Because F's $$$n \leq 20$$$,so I thinked about its $$$O(2^n*n^2)$$$ algorithm.

      Then I thinked and debugged D until 70mins.(I'm a SB!)

      I didn't solve any problems like E before,so I didn't see it anymore() Now I know it is easy.

»
4 месяца назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится
Me after every ABC
»
4 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I only made AB...

»
4 месяца назад, # |
Rev. 9   Проголосовать: нравится -12 Проголосовать: не нравится

Hello everyone!I the round gone well.I hope that you all will get positive delta from this contest. Can someone explain me what is wrong in my code for E problem?

https://atcoder.jp/contests/abc338/submissions/49737722

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

$$$D > > > > > E$$$

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

Did anyone manage to cheese $$$2^n \cdot n^3$$$ on F? I got to (32xAC,2xTLE) before realizing the $$$2^n \cdot n^2$$$ optimization and getting AC.

Also E has appeared in a previous ABC/ARC. I can't seem to find the link but the problem involved points on the sides of a square (instead of a circle) and drawing arbitrary curved lines between them (instead of chords) but the solution is identical. Granted, its an educational contest, so it probably doesn't matter too much.

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

What is the difficulity score of Problem D E F based on codeforces rating system?

»
4 месяца назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится
A
B
C
D
E
F
G
  • »
    »
    4 месяца назад, # ^ |
    Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

    You don't need an RMQ data structure for E.

    I'm assuming $$$A_i \lt B_i$$$ in the following notation for simplicity. You can just swap them if they aren't, it still represents the same chord.

    Keep a stack and process the chord endpoints in order from $$$1$$$ to $$$2n$$$. When you reach $$$A_i$$$, push $$$i$$$ onto the stack. Then when you reach $$$B_i$$$, check if $$$i$$$ is on top of the stack.

    If some other value (say $$$j$$$) is on top of the stack it represents a pair of chords with $$$A_i \lt A_j \lt B_i \lt B_j$$$, i.e, chords $$$i$$$ and $$$j$$$ intersect, so it isn't possible. Otherwise no chord intersects $$$i$$$, so we just pop it from the stack and continue.

    Submission

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

D>>>>>>E>C>B>A,the worst thing is that i only WA one point in E...

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

Can someone tell why my binary search code doesn't work for C

My Code
»
4 месяца назад, # |
Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

Could someone help me figure out why doesn't my binary search solution work for C , my logic is pretty straightforward , the maximum no of times we can make dish A and B respectively are min(Qi/Ai) and min(Qi/Bi) over all i from 1 to n.

Now I binary search within 0 and (alim+blim) where alim = min(Qi/Ai) and vv. Since there are n+1 ways to represent a number as a sum of two numbers , so I iterate and find the numbers matching the condition, however my code fails the last seven test cases .

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

    Take a look at Ticket 17291 from CF Stress for a counter example.

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

      Ah I see now , I did have a faint premonition that this might be one of the counter cases where the minimum limits for my a and b occur at the same index , I'd tried to rectify in later attempts too but due to my faulty implementation I screwed up some other test cases too.

      I eventually upsolved this problem but without binary search this time , as the binary search idea involves too much hassle. Thanks for your help btw.

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

    No offense but I would like it if you could help me figure out what's wrong with my code , if I had to look for a solution I would've read the editorial.

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

      I did not reply to you, did I? just shared a reference for anyone searching.

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

        It did seem that way from my pov , it's the first time I'm using the comment section so that might be it.

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

My solution to problem F is a little bit different from the one in the editorial.

I also use dp[st][i] to denote the minimum weight under the condition that we have visited all the nodes in the bitmask of st, and we are now at the i-th node. Then, we use function numof1(st) to denote the number of 1s in st, and my algorithm works as follows.

Initially, we have dp[st][i]=0, where numof1(st)=1.

Then, suppose that we have got all the values of dp[st][i], where numof1(st)=1,2,...,k-1, and we are going to find dp[st][i], where numof1(st)=k, by using dp[st'][j], where numof1(st')=k-1. For dp[st'][j], we can go to any dp[st][i], if and only if, st=st' | (1<<i), and there is an edge from node-j to node-i.

Next, for any dp[st][i], we find all the nodes involved in st, and update dp[st][i] again, by using Dij algorithm.

Finally, the answer is the minimum one of dp[(1<<n)-1][i].

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

Hi,everybody,I found a problem in E Here is the Sample Input 3 114 514 512 113 115 513

But Atcoder's Output is No and somebody's AC code'output is No But somebody's AC code'output is Yes and I try drawing a picture,I found that there is an intersection between the chords, Can you help me?

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

link to my submission for problem C in atcoder beginner contest 338

help me in debugging this code please..I am getting WA only for the middle two test files