We will hold NS Solutions Corporation Programming Contest 2023（AtCoder Beginner Contest 303）.

- Contest URL: https://atcoder.jp/contests/abc303
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20230527T2100&p1=248
- Duration: 100 minutes
- Number of Tasks: 8
- Writer: nok0, m_99, evima
- Tester: physics0523, yuto1115
- Rated range: ~ 1999

The point values will be 100-200-300-400-475-525-550-600. We are looking forward to your participation!

Problem statement of C is ambiguous,it says we can only consume an item at a point if health is strictly less than K at that point.

But in sample 2 it says -

`'Note that although there is an item at his initial point (0,0), he does not consume it before the 1-st move, because items are already consumed after a move.'`

but the health(h=1) is less than k(5) , shouldn't we consume the item and if not when exactly does it gets consumed so it's not available now?Takahashi can consume the item

after each move.Considering this, he wouldn't be at $$$(0,0)$$$ after a move.So if he comes back to (0,0) in future with h<k, he can consume the item?

Yes.

So in sample input 2 the item at (0,0) should still be there ,but the explanation says- 'because items are

alreadyconsumed after a move'. Why?bad translation I think, it should be

onlyinstead ofalreadywhat was the problem in setting constraints for F such that overflow could be avoided? Had "fun" whole contest trying to fix overflows.

Bruh. If not for the overflow I would've had AC in the contest

same :D

could you elaborate your soln ?

Is Ex related to Cayley's formula for Prüfer sequence.

I really like and appreciate the atcoder platform but sometimes the ABC's do feel unbalanced.

Different Solution for E:

A node with degree > 2 is the center of star. Hence for each such nodes we can append its degree to the answer and remove it along with its neighbors because they are just leaves in some star.

We are left with stars of level 2. Just count the number of remaining nodes and divide it by 3 to obtain the number of level 2 stars.

I did the same thing, its much simpler than provided in the editorial.

I implemented the same idea.

I just counted how many nodes with degree >1. then for first two stars, two nodes of degree 2 required and for each next star added, 2 nodes of degree 2 added, so something like x+y = total number of nodes>1.

Can you explain problem in simpler terms? I was unable to understand problem.

SourceThe star graph Sn of order n, sometimes simply known as an "n-star", is a tree on n nodes with one node having vertex degree n-1 and the other n-1 having vertex degree 1. Source: https://mathworld.wolfram.com/StarGraph.html

Implementationhttps://atcoder.jp/contests/abc303/submissions/41791382

But for this sample:

`6`

`1 2`

`2 3`

`3 4`

`4 5`

`4 6`

the answer should be

`2 2`

, why does your code output`1 3`

?This is not a valid testcase, The problem states:

statementhttps://atcoder.jp/contests/abc303/tasks/abc303_e#:~:text=choose%20two%20vertices,chosen%20two%20vertices

However if you connected (5,3) or (6,3), It will yield two level 2 star graphs.

how to solve F ?

How to solve F?

How to solve problem D???

You can use DP to solve the problem, consider the switching ON and OFF of the caps lock the states of you DP, now as far as transitions are concerned if you want to press the letter 'a', you can do this either by CAPS OFF + X or by CAPS ON + Y, and vice versa for the letter 'A'.

spoilerin F ,I tried to use Binary Search + DP . I apply binary search on the number of turns required and use Dynamic Programming to determine if given number of turnscan do the job or not . I got the basic test cases passed but it shows RE on other cases . Please help me identify the problem . (It is probably because of the large size of dp vector I use) Here is my submission:

(https://atcoder.jp/contests/abc303/submissions/41782706)

My submission of F gets AC on 38/40 of the test cases. Can anyone tell me what is the problem?

Apparently, the large numbers need not fit in 64 bits, as said in the editorial.

I failed the same two cases because of not considering that for a few turns the partial damage of an attack can be better than the full damage of another attack, since I see you have only

`max(a1,a2)`

in your code, you may have the same issue.