AtCoder Beginner Contest 359 A-G in 4 Minutes [English Subtitles]

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024

ความคิดเห็น • 54

  • @dotter-h3s
    @dotter-h3s 3 หลายเดือนก่อน +10

    ABC初参加でCが(過去問を除いて)人生で3問目の問題でした
    難しかったです

  • @evimalab
    @evimalab  3 หลายเดือนก่อน +7

    C: 制約を見間違えていました……が解法には影響しないはずです。
    I figured the constraints wrong... but it should not affect the solution.
    Wrong: -2*10^16

  • @将棋脳
    @将棋脳 3 หลายเดือนก่อน +17

    3問目わけわからんくてヤケクソ提出したら通って嬉しかった

  • @ruku_prog
    @ruku_prog 3 หลายเดือนก่อน +5

    C問題の制約なんですけど、第一象限のみ考える問題です!
    0

    • @evimalab
      @evimalab  3 หลายเดือนก่อน +2

      ご指摘ありがとうございます。間違えました。
      ただし、第一象限に限っても特に簡単にならないはずです(スタートとゴールの方向関係は相変わらず自由です)。

  • @コメント用-m8j
    @コメント用-m8j 3 หลายเดือนก่อน +1

    パフォーマンスが 前回ABCD < 今回ABC になるくらいCが強かったけど解けたから嬉しい
    Dはdpっぽい雰囲気を感じたけど組み方がね……

  • @naoyah7242
    @naoyah7242 3 หลายเดือนก่อน +1

    C問題、難しいとか言われてたので、やってみたら解けたので非常に嬉しかった(リアル参加できなかったのであとでやった)。x方向右に行くか左に行くかでコスト0で一つ進めるかで考えました。D問題のDPでキーに文字列を使う発想がなかった…(いつも数値だったので…)。E問題のs = [(0, 0)]はs= []でも問題ないですか?(python知らないので初期値で何らかの値が必要なら必要になりますが)。FはまだしもGはさっぱり…解けるのがすごい

    • @evimalab
      @evimalab  3 หลายเดือนก่อน +2

      Eの初期値は [] で問題ありません。
      [(0, 0)] は [(INF, 0)] の間違いでした(こうすれば while のループ条件で空でないことの確認を省けます)。

    • @naoyah7242
      @naoyah7242 3 หลายเดือนก่อน

      @@evimalab なるほど!INFだと確かに空でないことは不要ですね。

  • @JD-is8yg
    @JD-is8yg 3 หลายเดือนก่อน

    面白かった〜 5完でした…
    どれも一筋縄ではいかなくてボッコボッコにされちゃいました

  • @トトンテテ
    @トトンテテ 3 หลายเดือนก่อน

    C問題、高さyのミノをyだけ左に動かすとイメージしやすくなる

  • @called3875
    @called3875 3 หลายเดือนก่อน +1

    初めてB,Cまで行けたけど実装方法が難しかった

  • @parsabushehri5488
    @parsabushehri5488 3 หลายเดือนก่อน

    problem C wrecked me bro

  • @davinho-b6r
    @davinho-b6r 3 หลายเดือนก่อน +2

    hi evi, if i'd like to practice by topic on atcoder, how can i do that ?

    • @evimalab
      @evimalab  3 หลายเดือนก่อน

      This app is Japanese-only, but I think you can use it: andoryoto.github.io/WebApplication/searchapp/
      This lets you search words in problem statements or official editorials of ABC and ARC.
      For example, if you want to practice Dynamic Programming, you can ask ChatGPT to translate it into Japanese (AI should work fine here) and search "動的計画法".

    • @davinho-b6r
      @davinho-b6r 3 หลายเดือนก่อน

      @@evimalab thank you, i love japan because of u

    • @A57278
      @A57278 3 หลายเดือนก่อน

      Will atcoder tags work again ?​@@evimalab

  • @sakamiyari
    @sakamiyari 3 หลายเดือนก่อน

    Cで質問なんですけど、制約でS_y,S_x,T_y,T_x>=0なはずなんですけど...

    • @sakamiyari
      @sakamiyari 3 หลายเดือนก่อน

      でも難しい発展問題として参考にしていただきます!

    • @evimalab
      @evimalab  3 หลายเดือนก่อน

      @@sakamiyari ご指摘ありがとうございます。実際には全く難しくなっていないと思います。(すべて非負でも S_y, S_x を自由に選べてしまうので……)

  • @UbiycaCrabov
    @UbiycaCrabov 3 หลายเดือนก่อน +8

    I am very pleased with myself that I solved the problem C in half an hour and using the formula that I wrote on paper.

  • @メタな人
    @メタな人 3 หลายเดือนก่อน +1

    初めて本番でC解けた!うれしい!

  • @lukastoupal4734
    @lukastoupal4734 3 หลายเดือนก่อน +1

    Hello evima, thx for the tutorial! I was thinking if problem C could be solved by thinking of starting tile from which we imagine graph of absolute value - sort of a 'V' shape that has 2 points as a base and then check if the end point is inside that graph? Because if it is inside, then the answer is simply abs(sy - ty) and I couldn't quite find what to do when it is outside of the 'V' shape. I could only think of finding the boundaries of the absolute value and then ask whether the end point is further than the boundaries. Can this approach work?

    • @evimalab
      @evimalab  3 หลายเดือนก่อน +2

      It seems your approach is what I explained in the video without the shifting and flipping.
      Here is a "stationary" version of the explanation which might work better for you: atcoder.jp/contests/abc359/editorial/10279
      If I understand you right, you can tweak my code there and get what you want.

    • @lukastoupal4734
      @lukastoupal4734 3 หลายเดือนก่อน

      @@evimalab You are right, the approach is actually the same, you just nicely simplified this idea, I'll try to better understand 🙂

  • @ひろえもん-x9i
    @ひろえもん-x9i 3 หลายเดือนก่อน +1

    atcoderの解説に載ってたんやけど
    evimaさん何者?

    • @evimalab
      @evimalab  3 หลายเดือนก่อน +12

      問題文の英訳を担当しています。たまに問題の発案もします。

  • @uddalakseal9320
    @uddalakseal9320 3 หลายเดือนก่อน +1

    i wish there was a english version of this

    • @evimalab
      @evimalab  3 หลายเดือนก่อน

      Just in case you miss it, the video has English subtitles. (Multi-language audio, that is, English voiceover is not yet available to this channel.)

    • @manishkumar-uw5mw
      @manishkumar-uw5mw 3 หลายเดือนก่อน +1

      ​@@evimalabplease try to do in English. It will be very helpful

    • @evimalab
      @evimalab  3 หลายเดือนก่อน +2

      @@manishkumar-uw5mw I will add English voiceover when TH-cam allows me to. (More than 90% of the viewers are from Japan, so I guess that's it.)

  • @川田康弘-u5v
    @川田康弘-u5v 3 หลายเดือนก่อน

    Cなにw
    中学受験の算数でてきそう
    俺は無理だった

  • @たい-b2x
    @たい-b2x 3 หลายเดือนก่อน

    D問題が難しかったのでE問題に行ったら解けました
    動的計画法が思いつかなかったです

  • @瀬尾求
    @瀬尾求 3 หลายเดือนก่อน

    Cの入力は常に非負では

  • @0xCP
    @0xCP 3 หลายเดือนก่อน

    Can you explain the dp solution for D more?

    • @evimalab
      @evimalab  3 หลายเดือนก่อน

      For an integer i and a length-(K-1) string s consisting of A and B, let dp[i][s] = the number of ways to determine the first i characters so that the last K-1 of those equal s without having a length-K palindrome as a substring.
      For example, if K=4 and s = "ABB", you cannot add A because "ABBA" is a palindrome, but you can add B (if the given string allows it), after which the new s will be "BBB".
      When i < K-1, s can be shorter than length K-1, or you can prepend dummy characters.
      You can use hashmaps to maintain s as a string or convert it to a bitmask.

  • @kavascgcf
    @kavascgcf 3 หลายเดือนก่อน

    in g in editorial how in one dfs you are calculating the sum for an single color by rerooting ?that when i change an edge how much change will come

    • @evimalab
      @evimalab  3 หลายเดือนก่อน

      I don't see a point in rerooting here. Just count the contribution of each edge (like (cnt[v] * (total - cnt[v])) and you are done.
      Here is my code: atcoder.jp/contests/abc359/submissions/54778861
      (Rerooting works but it would need strictly more work.)

    • @kavascgcf
      @kavascgcf 3 หลายเดือนก่อน

      @@evimalab thanks sir

    • @kavascgcf
      @kavascgcf 3 หลายเดือนก่อน

      @@evimalab thanks sir i got it im just stupid

  • @RE-mw4nu
    @RE-mw4nu 3 หลายเดือนก่อน

    質問です
    E問題で解説していたstackの解法の計算量ってどれくらいになりますか?水の高さを同じになるようにした塊のようなものを合併して、stackにはひとつの要素として入れると思うのでO(n^2)を超えることはないのはわかるのですが、正しい計算量はどれくらいなのでしょうか?

    • @evimalab
      @evimalab  3 หลายเดือนก่อน

      線形時間です。
      atcoder.jp/contests/abc359/submissions/54776467
      このコードで append() はちょうど N 回実行され、そのときに入ったもの以外は pop() できない(妙な初期要素を入れてしまいましたが無視してください)ため pop() の回数は N 回以下です。

    • @RE-mw4nu
      @RE-mw4nu 3 หลายเดือนก่อน

      @@evimalab ありがとうございます!stackに追加される回数を考えればよかったんですね!!

  • @Noobish_Monk
    @Noobish_Monk 3 หลายเดือนก่อน

    Why centroid in G??? There is a much simpler way with compressed trees

    • @evimalab
      @evimalab  3 หลายเดือนก่อน +2

      I doubt it's "much" simpler, especially if you don't have prewritten code. Also, Centroid Decomposition is one of the to-go solutions for this kind of problem.

  • @yosefmahmoud3715
    @yosefmahmoud3715 3 หลายเดือนก่อน

    First!

    • @A57278
      @A57278 3 หลายเดือนก่อน +1

      يا فرحة امك بيك

    • @yosefmahmoud3715
      @yosefmahmoud3715 3 หลายเดือนก่อน

      @@A57278 كسمك

    • @yosefmahmoud3715
      @yosefmahmoud3715 3 หลายเดือนก่อน

      @@A57278kosooooomk

    • @A57278
      @A57278 3 หลายเดือนก่อน

      @@yosefmahmoud3715 ابويا ع امك

    • @yosefmahmoud3715
      @yosefmahmoud3715 3 หลายเดือนก่อน

      @@A57278 koooooosomok