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

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

We will hold UL Systems Programming Contest 2023(AtCoder Beginner Contest 286).

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

We are looking forward to your participation!

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

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

Does any Chinese even participate a contest on Chinese New Year's Eve?

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

How to solve F ? I tried crt, but not a single AC :(

Submission.

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

How to solve $$$F$$$ and $$$G$$$?

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

In F, is it possible to have multiple answers? if no, then how can i prove it?

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

    F is Chinese Remainder Theorem. $$$4,9,5,7,11,13,17,19,23$$$ are coprime integers that satisfy the CRT conditions and product is greater than $$$10^9$$$ and sum less than $$$110$$$. From the judge, try to find $$$N$$$ mod these integers. Then by CRT, you can find $$$N$$$ mod their product, which is that number itself since $$$N$$$ is guaranteed to be less than $$$10^9$$$.

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

how to solve c?

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

    Bute Force:

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

Any hind for E?

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

This contest is great! The solution of G is wonderful.

Solution of G:

We call the edges in the set "neseccary", and others "unneseccary".

First, find all the connected blocks of the subgraph with only unneseccary edges. You can transfer between the point in one block by them optimally. They can be looked as ONE point.

Now, the graph contains only neseccary edges. The last thing is only judging if it can be drawn with one stroke.

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

Solution to F:

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

can E be solved using BFS

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

Is it possible to solve the last problem only with cross products and without the segment intersection?

  • »
    »
    4 года назад, скрыть # ^ |
    ← Rev. 8  
    Проголосовать: нравится +36 Проголосовать: не нравится

    Well, if what I believe is correct, it is possible. Let us simply compute the entire convex hull of $$$C \cup \{ S,T \}$$$. Now, there will be two paths on that convex hull connecting $$$S$$$ and $$$T$$$, one going clockwise, one going counterclockwise (assuming both $$$S$$$ and $$$T$$$ are on the hull). The answer is the minimum of the two. If either $$$S$$$ or $$$T$$$ is not on the convex hull (at least one of the two must be on it, but one may not be on it), then the straight line segment connecting $$$S$$$ and $$$T$$$ must not intersect with $$$C$$$ (if the line intersects with $$$C$$$, then both $$$S$$$ and $$$T$$$ must be on the hull*), so in that case $$$\text{dist}(S,T)$$$ is the answer.

    *UPD: Here's the proof on the intersection part. Let us assume $$$S$$$ was on the hull, and $$$T$$$ inside it. Now let's think of the hull incrementally, adding $$$S$$$ first and then $$$T$$$. For $$$T$$$ not to be added to the hull, $$$T$$$ should be inside the hull. This is either inside the polygon, or at a point where there is no intersection with the segment and the polygon. The former case is already eliminated from the task, and our proof is finished.

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

      This is a smart solution! I just bashed the problem using disjktra, where vertices are point of the polygon, S and T, edges are the original edges of the convex hull and an edge from S to vertices of the polygon that don't cross the polygon, and likewise for T. It's easy to computer the last two set of edges using line hull intersection but it's quite a bit of code

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

    You can find out if two segments intersect without using anything more than some cross and dot products