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

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

We will hold AtCoder Beginner Contest 233.

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

We are looking forward to your participation!

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

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

This is the last ABC in this year. As a writer, Merry Christmas!

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

    crap I solved this problem a few days ago. Too dumb of me that when I solved the F, I didn't read the G because 20 minutes only was left so I said it is impossible for me to get it.

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

How to solve C without DFS that is given in the editorial?

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

I had a different solution to E that did involve converting to an integer. It's best explained if the input is a 4-digit number with digits $$$a, b, c, d$$$. We see that $$$a$$$'s contribution to the result is $$$a(1000 + 100 + 10 + 1) = a(10^4 - 1)/9$$$. The total result is $$$\frac{1}{9} [a(10^4 - 1) + b(10^3 - 1) + c(10^2 - 1) + d(10-1)] = \frac{1}{9} (10X - (a + b + c + d))$$$, and in general it is (10X - (sum of digits of X)) / 9 which can be calculated quickly enough in python.

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

Can G be solved using flows?

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

Why was problem H called Ex?

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

For problem F, can someone please explain a bit more :
if you repeat “choosing an arbitrary edge that is not a bridge and removing it,” then it ultimately becomes a forest without changing the connectivity. You can place the desired piece to each vertex in order, with leaves processed first.

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

    Given any graph G, if you keep removing non-bridge edges from it, you end up with a spanning forest. Basically in that solution, you can pretend that non-forest edges are not present (i.e. you can find a solution that doesn't use those swap operations)

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

https://atcoder.jp/contests/abc233/submissions/28135244 I am not able to figure out why my submission timed out for E.

I took input as a string, calculated sum till i th digit and stored it in a array, then i computed the digit (sum%10) and carry (sum/10) in reverse order.

If carry is non zero append it to the final answer. can someone help me debug it

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

Can someone please give me a testcase where my solution for F is failing. Logic — make components and check if i(in p vector) and i(in c vector) are together or not, if not, then return false, else for each pi in the component, find its position and place it at index pi.

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

I found a testcase for Task F in which someone might take greater number of operations then allowed ( 5 * 105 ).I tested it here.

Testcase Generator

Test case seems correct to me, Please verify it. If it is correct consider it adding as test case.

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

What's wrong with this solution for F:

1) Remove extraneous edges such that we end up with a forest.

2) For arbitrary leaf node in the forest, keep swapping until we get it to be in the right place, at which point we remove the sole edge coming out of it.

Can't seem to find a counterexample.

EDIT: Can someone share test data?