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

Автор -emli-, история, 7 лет назад, По-английски

AtCoder Beginner Contest 070 will be held.

Time:August 12th (Saturday), 21:00 JST

Duration: 100 minutes

Number of Tasks: 4

writer: Hec

Rating: 0-1199

The point values are: 100 — 200 — 300 — 400

We are looking forward to your participation!

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

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

My first solution for D (which use recursive DFS) got RE, so I had to rewrite a non-recursive DFS solution in order to get AC. Is it because of the low stack size limit for Python?

A bit unrelated, but I want to ask Python user how do you deal with problems that require Balanced BST? There is nothing similar to set, map in C++, and it's definitely not a good idea to re-invent the entire thing under the constrained time of the contest.

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

The editorial defines a struct instead of make_pair():

using edge = struct { int to; ll cost;};
vector<edge> tree[limit];

The main benefit I see is that you can reference the components by meaningful name like ".cost" instead of ".second".

Is there any other benefit?

p.s. That new syntax of "using" versus "typedef" is also cool.