atcoder_official's blog

By atcoder_official, history, 2 months ago, In English

We will hold AtCoder Beginner Contest 447.

We are looking forward to your participation!

  • Vote: I like it
  • +45
  • Vote: I do not like it

»
2 months ago, hide # |
 
Vote: I like it -15 Vote: I do not like it

1st

»
2 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

I hope I can solve 5 problems and get Cyan.

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    2 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    same brother I too not sleep late, codeforces contest is at 21:35+ while AtCoder is at 19:00 in Thailand.

»
2 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

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

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    2 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    submission WA on the same 10 testcases.

    • »
      »
      »
      2 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      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.

  • »
    »
    2 months ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    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

    • »
      »
      »
      2 months ago, hide # ^ |
       
      Vote: I like it +3 Vote: I do not like it

      degree=2 can form a chain of length 1. I tunnel visioned on handling degree 3 and >3 only. didn't notice n>=3 gaurantees one degree 2 node.

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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).

  • »
    »
    2 months ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    brother from my knowledge I don't think we can really check testcase there like we do on codeforces. maybe stress test it by making one cpp file generating input and check it with the AC submission of someone.

  • »
    »
    2 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    You cant and this is by design.

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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...

  • »
    »
    2 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    brother I did like in total 9 case work considering the front of string s and t (probably the same to you) did you miss to list out any case ? like when front of s and t are not 'A' but not the same etc.

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
»
2 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

Too many exception handlings for some rating critical problems :/

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

ABCDE but Rated-2

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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?