We will hold AtCoder Beginner Contest 407.
- Contest URL: https://atcoder.jp/contests/abc407
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20250524T2100&p1=248
- Duration: 100 minutes
- Writer: sheyasutaka, MMNMM
- Tester: physics0523, kyopro_friends
- Rated range: ~ 1999
- The point values: 150-250-300-425-450-550-600
We are looking forward to your participation!









qp.
Best wishes to everyone RP++.
qpzc
In the fourth problem ,I didn't get scores for two testing points. who can help me? i will subscrible you.
DON'T talk about the problems during the CONTEST!
Terrible contest.
Hello, I'm beginner. Could anyone tell me which test case in problem C I might have missed?
My code :
What if S only contains one character?
Can anyone please help me out? My solution is failing on 1 testcase.
My approach was:
xorvalue of uncovered cells and takemaxover all valid masks.WHICH CASE DID IT WRONG IN. IT PASSED 11 CASSES, 1 TLE 5 REs. Why is it wrong ? It worked for all cases given in problem description
Since $$$|S|\le 5\times 10^5$$$, and your function
transform_numberhas a time complexity of $$$O(n^2)$$$ (by string slicing) and you even call it more than once, it'll definitely TLE. Btw, the reason of your RE might be that the interpreter stored all the result strings produced by slicing operations.thanks for the help
link to complete solution — https://atcoder.jp/contests/abc407/submissions/66133301
for 4th question I checked if the mask formed by a number can be a valid domino placement using this function
so if domino placement looks like
my mask should be
110011010001I thinkbasically I am checking last set bit of a mask and removing that bit and one of its neighbor (
posandp) and remaining mask will be smaller so that can be checked with a DPI suspect this logic might be wrong as other parts of my solution seem simple, but I am getting almost all WAs :P .. can someone help please
nothing wrong with my logic... i am reading 32-bit integers for array values .. but it should be 64-bit long long values ... yikes man !!!
I think F=MAXI.
It is. I use yuantiji and it gives me the same problem.
can someone please explain E?
First, you know that the first value will always be a '(' and the last value will be ')'. Then at no point in the sequence can the count of ')' be greater than the count of '(' otherwise no matter which numbers you choose there will be a valid construction. So you can find the largest possible by adding the first value to the ans, then looping through the middle section and pushing the values to a priority queue, and every second number (as you need to have at least the same number of '(' as you have')' ) you pop the largest value and add it to your answer.
I think i use a different procedure than edito.
Build the answer 2 char by 2 char, maintaining a heap of values on ")". Either append () or if there is a ) before and it gives more point to flip it to ( and append )) do that.
Can anyone please explain approach to problem D. I saw the constraints were very low and thought of recursion. I thought of generating all possible domino placements and finding the maximum answer. However I was unable to code it out.
Your idea is correct.
You were correct in thinking that. Since you can place a maximum of 10 domino, out of 20 cells in grids. You have three choices for each cell, place type 1 domino, type 2 domino, or keep empty. You can represent the current state of grid using bitmask, each bit representing a grid cell from 1 to 20, and it's occupied status. Keep the visited states in a set, to recalculate earlier states.
Bitmask DP, consider your state as int mask
where mask is nothing but a matrix of dimension H x W which is upto 20 bits so can cache whole grid configuration itself,
Can segtree work for F ? each node contains the answer for the segment, and a prefix max and suffix max of the segment.
I'm unsure of the time complexity.
I understand how to solve E, but still can't solve the D. any things please.
I made a mistake of not initializing one variable in G and got WA on samples. I lost my AK :(
does anyone know when's the 408th ABC going to be hold? What I can see now is just the 410th ABC, missing 2 contests btw.
I've got bad luck... I nearly solved C and D...
Can someone explain E ?
Good F,greatly better than the one in ABC406 which is a classical ds problem.