2

AtCoder Beginner Contest 272 Announcement

 1 year ago
source link: http://codeforces.com/blog/entry/107740
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

We will hold AtCoder Beginner Contest 272.

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

We are looking forward to your participation!

8 hours ago, # |

my favourite

102 minutes ago, # |

How to solve task E?

  • 99 minutes ago, # ^ |

    Just keep incrementing the i-th element by (i+1) and put them into a set for each m. Need to speed up the process by only caring about the cases where the number just becomes 0 and smaller than n. My solution

    • 95 minutes ago, # ^ |

      I'm not able to get the intuition on why it will fit in the time limit :/

      Any hints regarding the same?

      • 93 minutes ago, # ^ |

        Because first element is used at most n/1 times, second — n/2 times and so on. So, in total maximum sum over all answers = n * (1/1 + 1/2 + ... + 1/n) ~ n * log(n).

        • 81 minute(s) ago, # ^ |

          but after all this process how you find mex?

          • 55 minutes ago, # ^ |

            take a look at this code Code

94 minutes ago, # |

Rev. 4  

0

Actually I don't think problem F fits for its position, it would be better to swap it with G indeed.

  • 91 minute(s) ago, # ^ |

    Rev. 2  

    +2

    in F you just implement hash + bs, G is some thinking

    upd. uh, just realized that TL is 2 sec (not 4 as I though) and my runs 1.4, so mostly you are right

    • 68 minutes ago, # ^ |

      I stalked your submission and your library for string hashing looks very cool: https://atcoder.jp/contests/abc272/submissions/35487307

      Binary search to get lcp, then use lcp to lexicographically compare substrings, and then sort with those comparisons to get SA. I've never seen it done this way, I might steal this template for my personal use!

      • 50 minutes ago, # ^ |

        thanks and enjoy other codes of mine :)

        One major moment in this solution is stable_sort. It has less calls to comparator than usual sort (that gives TLE)

80 minutes ago, # |

I tried using BFS in Problem D, but I am not able to pass the 3 tests. Can someone help me find the issue? https://atcoder.jp/contests/abc272/submissions/35485981

74 minutes ago, # |

In problem D many are using the condition (i*i+j*j==M) how do we know that this will work? Please anyone help.

  • 48 minutes ago, # ^ |

    Rev. 2  

    0

    The euclidean distance is invariant under linear shifts. If is at square distance from , will also be at square distance from . Therefore we find all that are at distance from (which is the condition you see everywhere). Then, all neighbours of will be .

    • 38 minutes ago, # ^ |

      What are p and q? What i am seeing is if(i*i+j*j==m) then they are building edges of length (i,j) (-i,j) (i,-j) and (-i, -j) from each node. Can you explain more clearly please

73 minutes ago, # |

Rev. 2  

0

On problem D, I think it will be possible to solve the problem in by precalculating the possible movements. (I did it in through a brute-force precalculation.) Did anyone solve D with this method also?

  • 50 minutes ago, # ^ |

    I also first enumerated the possible moves, but I did so by enumerating all s.t. , which takes to enumerate them.

70 minutes ago, # |

Rev. 3  

0

I used the SA-IS algorithm in problem F but failed. I thought my idea was genius but the jury thought I was an idiot. Would you please review it?

Submission(272F)

  • 47 minutes ago, # ^ |

    Rev. 2  

    0

    Spoiler
    • 46 minutes ago, # ^ |

      Before reviewing it, I first pressed the upvoting button.

    • 8 minutes ago, # ^ |

      Rev. 3  

      +1

      Yes, there are counterexamples.

      Here is my code:

      string s1 = s, t1 = t;
      s1.pop_back();
      t1.pop_back();
      string large = t + t1 + s + s1;

      In my concatenation, the large is . The first starts from No.4 (0-indexed) whose suffix is , the second starts from No.10 whose suffix is . . My algorithm would not count this pair but this pair is definitely valid.

      For the correct answer, please refer to the tutorial/editorial.

      This is the link to the original problem (ABC272F Two Strings).

55 minutes ago, # |

I think problem E is very nice for "learning how to analyze complexity". In fact during contest, I could not convince myself that the complexity is O(NlogN) rather than O(NM), but after reading the editorial, I really like the idea of "important values".

Besides, problem F is somehow about suffix array, which is really really a difficult topic for me, not even to talk about that clever construction in editorial. It seems that I should find time to learn suffix array again.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK