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

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

We will hold AtCoder Beginner Contest 447.

We are looking forward to your participation!

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

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

1st

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

I hope I can solve 5 problems and get Cyan.

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

Since time zones don't really work easily for me in Singapore I can only do AtCoder for now

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

i love when i check first pages of standings and there are >50% cheaters.

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

Please help me out, why is my submission for $$$F$$$ wrong? I struggled for an hour, still can't figure it out.

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

    submission WA on the same 10 testcases.

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

      Just a heads up. Here is how I would recommend solving the problem using my reroot template:

      default = [0] * n
         
      def combine(nodeDP, neiDP, node, eind):
          return max(nodeDP, neiDP)
         
      def finalize(nodeDP, node, eind):
          deg = len(graph[node]) - (eind >= 0)
          if deg >= 3:
              return nodeDP + 1
          elif deg == 2:
              return 1
          else:
              return 0
      
      rootDP, forwardDP, reverseDP = rerooter(graph, default, combine, finalize)
      print(max(rootDP))
      

      Note that the variable deg inside finalize is the degree of the node in its subtree, where eind is the pointer to the parent of the node (which is -1 if the node is the root of the entire tree). In the end rootDP[node] contains the length of the longest centipede path ending at node. So max(rooDP) contains the length of the longest centipede path.

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

    initialize ans with '1' as if the tree is a straight chain the answer is 1 and also from the clarifications too the answer can never be '0'

    actually I was also initializing it from '0' and realized it after the end of the contest

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

i am new to atcoder, and i gave today's contest. my code failed in some testcases, and i wan't to know if there's any way to check the testcases to debug my code (post-contest).

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

My C submission ended up having 32x AC, and 1 WA, did it happen to anyone else?

And i think theres no editorial for C...

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

Too many exception handlings for some rating critical problems :/

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

ABCDE but Rated-2

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

My first virtual contest on Atcoder. I did ABC in <1 hr. Was able to do E afterwards. But no idea for D. How to know what rating would this lead to?