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

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

We will hold UNIQUE VISION Programming Contest 2023 Christmas (AtCoder Beginner Contest 334).

We are looking forward to your participation!

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

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

Are Japanese editorials for Beginner contests still translated just by using GPT-4 to English?

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

hope to solve ABCD.

good luck!

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

excited

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

Hope everyone has good grades!

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

Why this submission gives wrong answer for E? Any HELP is appreciated.

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

today,i fuc**ed up

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

A < D < B < C

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

Nice contest as usual, managed to solve 6 problems.

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

is $$$F$$$ dp?

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

Does anyone accepted G with Dynamic Connectivity?

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

I added hints for E — Christmas Color Grid 1 on CF Step

I created video editorial for F: Christmas Present 2. I also created 1D version so that you can submit $$$O(N^3)$$$, $$$O(N^2)$$$ and $$$O(N Log(N))$$$ solution.

Is this the right direction to approach G?

Spoiler
  • »
    »
    5 месяцев назад, # ^ |
    Rev. 3   Проголосовать: нравится +9 Проголосовать: не нравится

    Yeah, and the standard approach for checking articulation points gives you their exact count lol. I just built the graph and ran the cp-algo implementation on it.

    In that implementation, the number of times IS_CUTPOINT($$$v$$$) is called is the number of resulting components (except for the root where its actually “children — 1”).

    If you’re familiar with DFS tree, the intuition is pretty obvious, each child $$$v$$$ which doesn’t have a backedge that crosses over $$$v$$$ will be disconnected when $$$v$$$ is removed.

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

Is it intended that offline dynamic connectivity solutions receive TLE on problem G?

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

Solved A,B,D

D<B<<C

A- If conditions

B- Tricky implementation + Maths

D-Sorting+Binary Search+ Prefix Sum

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

Hardest B ever, lol. I spent around 1 hour for B but failed. D, E are quite trivial though.

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

The time is over right after solving E. Fuck

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

Horrible contest. Problem B very to hard for this division and no editorial. What else ?

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

I solved F just because I saw this before (The problem called Mowing the Lawn in USACO 2011 Open Gold Group)...

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

Speedcoder........

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

Why and where does this code give WA for problem E? any help ?

My submission

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

    Can you please elaborate on the idea behind your submission? I have solved the problem, but apparently with a different approach.

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

      Yes sure, I actually gave ids through string concatenation of row and column index, after that I performed merging of grid cells which are green, now so i will have components of green through dsu, then on every red cell I will check it's neighbor and identify what are the different component numbers in all 4 directions, then just adding the components we can achieve for every red cell to green. Then dividing by number of initial red cells which have equal probable to choose.

  • »
    »
    5 месяцев назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится
    s += to_string(r) + to_string(c);
    

    seems to be wrong. Row 1 Column 11 has the same string as Row 11 Column 1.

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

How can i download the testcase.txt in Atcoder?

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

https://atcoder.jp/contests/abc334/submissions/48787539 Can anyone tell me what's wrong with my code or help me download the testcase??? Thanks a lot!

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

Weird round, I solved ADE.

Now I've just finished upsolving B. Being that there's no editorial for the problem yet, I'll give an explanation of what I've done:

What we are being asked is easy to understand: we want the amount of numbers y in the range [l , r], such that y % m == a % m. One way to go about this is to subtract a from l and r, now the problem reduces to finding all y such that y % m == 0 in the range [l , r]. Good, this is easier because we can subtract (l — 1) % m to r % m and that will give us the amount of multiples in between... right? Well, the intuition is correct but there is a slight flaw: when l is negative the above formula doesn't work because of rounding. So what we can do is add m * (abs(l)/ m) to l and r and then apply the formula. Ta-da! Problem solved

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

please give me a little hint for problem b

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

for problem B why this logic is wrong

ll a, m, l, r;
cin >> a >> m >> l >> r;
ll ans = 0;
if (abs(l - a) % m == 0)
	ans++;
if (abs(r - a) % m == 0)
	ans++;
ans += abs(r - l - 1) / m;
cout << ans;

I am checking at l and r and between l to r

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

    Logic is simple. typical arthimetic sequence

    ll a, m, l, r;
    cin >> a >> m >> l >> r;
    
    ll kl = (l - a) / m;
    ll kr = (r - a) / m;
    
    if (a + kl * m < l) {
        kl++;
    }
    
    if (a + kr * m > r) {
        kr--;
    }
    
    ll first = a + kl * m;
    ll second = a + kr * m;
    
    ll ans = 1 + (second - first) / m;
    
    cout << ans << endl;
    
»
5 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

A<D<<B<<C,I hate problem B

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

I made video editorial for F: Christmas Present 2

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

B is hard,the hardest B I've ever done.(AC 15,WA 5) I think this is also the reason it gets 250 points but not 200 points.

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

Can anyone explain my question on B. For 0 2 1 10, why the answer is 5??