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

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

We will hold Panasonic Programming Contest 2024(AtCoder Beginner Contest 375).

We are looking forward to your participation!

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

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

Wow, the gap from B to C is huge o.O

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

C 400pts?That's so amazing.

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

What is the Distribution of Problem Statements on the top page for?

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

    AtCoder suffered DDoS attacks during some contests last year. During that period, Panasonic (also the sponsor of this contest) sponsored a contest, ABC301. To avoid the effect of the DDoS attack, they distributed the problem statements in PDF format during the contest.

    Later, when Panasonic hosted contests again, they might have directly copied the problem statements from previous contests without any modifications, so the PDF version of the problem statements was retained—even though the statement was still from ABC301.

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

375 is 3/8 times 1000.

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

As a participant, I confirm that problems are problems

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

G is almost the same as 567E

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

Can someone explain C and G?

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

    C is just implementation, do what the question is saying to do. Note that the operation rotates a square submatrix each time. The size of this submatrix goes from n to 1. For every index, figure out how many times it will get rotated(distance from edge % 4), and just do the operation that many times.

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

    For G I ran dijkstra and made a new graph based in all edges for all shortest path. an edge is part of a shortest path if it make the distance lower or keep the distance equal from 1 to some vertex when running dijkstra. Then I made a new graph based on this edges and found all bridges. bridges can make the new graph disconnected and then there won't be a path from 1 to N using that graph.

    For C, I divided the grid in layers (like a onion). in layer 1 you will rotate 1, and in general in layer i you will rotate each cell i times. find i%4 and rotate i%4 times, because after 4 rotations the cell will be in the same place.

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

      Thank you, can you please also explain how to find edges which are part of all shortest paths?

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

        Let dist[x] be the distance from 1 to x, and w[a][b] = weight of the edge ab

        if the distance from "1" to "b" is X, and dist[a] + w[a][b] = X, and b is in some shortest path, then ab is one of these edges.

        First I ran dijkstra and keep a "parent" vector, then I ran a bfs from N to 1 to make the new graph

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

      in problem $$$C$$$ I have to rotate for each $$$i$$$ upto $$$N/2$$$?Also how did you reach this observation?What was your observation?

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

        This way

        image

        Need to rotate all cells

        This is just what I got after read the statement. The main observation to solve the problem is you don't need to rotate i times, only i%4 times. and the other observation is how to get the layer. the layer is the minimum distance from i to 0, from i to n+1, from j to 1, from j to n+1

        int layer = min(min(i, n+1-i), min(j, n+1-j));
        layer %= 4;
        int ri = i, rj = j;
        for(int r=1;r<=layer;r++){
            swap(ri, rj);
            rj = n + 1 - rj;
        }
        ans[ri][rj] = gr[i][j];
        
»
2 года назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

Parkinson's disease, Crohn's disease, Sickle cell anemia, Amyotrophic lateral sclerosis (ALS), Alzheimer's disease, Multiple sclerosis (MS), Cystic fibrosis, Lupus, Tuberculosis, Hepatitis C, Rheumatoid arthritis, Diabetes mellitus, Hypertension, Asthma, Ebola, Malaria, Lyme disease, Dengue fever, Psoriasis, Influenza.

These are the diseases I suffered while trying to solve problem C.

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

Can somebody please help me understand my mistake in the submission for G? Submission Link-> https://atcoder.jp/contests/abc375/submissions/58739004

Edit: I got my error, my infinity value was not enough in dijkstra implementation.

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

Well, G is weaker than a well-known problem in China called Bridge.

Link: https://www.luogu.com.cn/problem/P2685

The solution is to calculate any shortest path of the graph first, and get the point for each point v where the shortest path from 1 or n to v part from the shortest path from 1 to n. For each edge (u,v) which is not on the path, we can know the range it can influence. So that we can use a segtree to maintain the shortest path from 1 to n when we delete an edge on the former path.

BTW, I tried to modify the code I wrote for that problem to pass G but failed :(

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

According to https://atcoder.jp/users/ynymxiaolongbao, his name at CF is YoshikaMiyafuji, not ynymxiaolongbao. If you just write the name on atcoder, wouldn't it be better not to connect it to the user's link like kyopro_friends?