A and B were solved and the rate increased slightly. The rest of the time was spent reading and discussing all the problems.
- I am thinking about how to develop Power of Attribution by verbalizing my thinking process on difficult problems and comparing it with official explanations and articles by strong people to find discrepancies.
By the way, I am in 956th place with a performance of 1357, but the fastest person with the same score is in 599th place with a performance of 1657, so it may actually be effective in the short term to increase the speed of answering gray difficulty questions.
- Thoughts.
- There are four, so there is plenty of room for a total hit. python
def solve(XS):
S = sum(XS)
if S % 2 == 1:
return False
goal = S // 2
for i in range(16):
s = 0
for j in range(4):
if i & 1:
s += XS[j]
i >>= 1
if s == goal:
return True
return False
def main():
# parse input
XS = list(map(int, input().split()))
if solve(XS):
print("Yes")
else:
print("No")
- I'm exploring the entire subset in bits.
- Official Explanation
- Sorting does not lose generality
- There are only two patterns that satisfy the equality condition when sorted
- D and C, D and B canât be in the same group.
- D + C > B + A (D > B, C > A)
- D + B > C + A (D > C, B > A)
- Thoughts.
- Consider N=2
- Three patterns of what happens after X is set to X-x
- When still large â further -x
- In short, mod x
- Time of equal â End
- When small â replace
- This is Euclidâs reciprocal division. python
- When still large â further -x
def solve(XS):
from math import gcd
from functools import reduce
return reduce(gcd, XS)
- Thoughts.
- N is 8, so you can check against all the sequences.
- Since 8!=40320
- If there is one bridge
- We can divide them into groups of less than v and l intervals.
- Unfeasible only when there is a camel heavier than v
- What if there is more than one?
- For example, a bridge of the same length with a higher load-bearing capacity can be ignored.
- Short bridges with the same load-bearing capacity can be ignored.
- Is the whole order established on the strength of the condition?
- thoughtless person
- N is 8, so you can check against all the sequences.
- Official Explanation
- Iâm not sure.
-
Pre-calculate the minimum distance between the right and left ends of all camel subsets and then search for all permutations with DP
- I see, so if the âsum of their weightsâ for all the sub-columns exceeds the load-bearing vi, then âthe ends are more than li apartâ, and if not, then 0 is fine.
- The sum of the weights of the subcolumns is a cumulative sum of constant order
- From M=100000 bridges, we need to find the longest one with a load capacity less than a given weight w
- If we do this naively with O(M), weâre not going to make it.
- Keep sorted by load capacity and search dichotomously
- Range maxâŠsegment tree?
- One end of the Range is fixed, so you can take the cumulative max beforehand.
- Now logarithmic order
- What then?
- They say DP Longest Path Search.
- If you want to use a library, is it OK to use negative cost and least-cost current?
- Thoughts.
- Nim, so if xor is 0 after the action, you win.
- Based on this, a game to compete for the placement of coins.
- Canât it be reversed if xor on the way is large enough?
- No, for example, 4 and 3 can be 0 at +1 when xor is 7
- There are so many possible distribution methods that some kind of compression would work, but I canât think of any.
- Official Explanation
- The evenness of N changes the game. - even and odd cases I should have.
-
The first player repeats the move âchoose the plate with the most coins on it and the bag with the most coins in itâ.
- How could we have recognized this strategy?
-
To try it out, I implemented the all-search solution method when the number of 3 is less than 10, and as a result, the first move does not win at all!
-
I have a hard time judging when there are so many mountains.
-
If you donât want to have too many mountains, you must want to consolidate the opposite side in one place as much as possible, and in such cases, it is often important whether you have a majority or not
- Thoughts.
- Isnât there a fixed number of tree edges in the whole area, so itâs not a game?
- Ah, well, itâs not always a tree.
- If you keep avoiding connecting 1 and N on your turn, you end up with two complete graphs
- The number of vertices in the final complete graph changes depending on which vertex is connected to which vertex that is not connected to 1 or N in the starting phase.
- Games to compete in this
- Not a âvertexâ but a âconnected componentâ?
- even-odd edges of a complete graph
- Odd when the remainder of the number of vertices divided by 4 is 1,2
- I donât know where to go from here.
- Official Explanation
- When does the first move win?
- Number of vertices in the original graph even and odd cases
- relevance - I hear itâs similar in structure to Tutteâs theorem.
F - Lights Out on Connected Graph
- Thoughts.
- Select a vertex and invert the color of the connected edges.
- The color of the edges can be blue.
- When can it be done?
- write for the purpose of examining
- Two-part graph?
- Yes
- Itâs an inversion, so it doesnât make sense to pick the same vertex over and over again.
- Separate selected and unselected vertices.
- There is no edge connecting the selected vertices to each other and the not selected vertices to each other (it would be red).
- This is a two-part graph
- Must also be consolidated.
- To determine if it is a bipartite graph, it is OK to paint it with DFS and make sure no inconsistencies occur bipartite graph decision.
- 17 vertices, so itâs not that slow to DFS.
- Try all 2^17 graphs, about 130,000 of them, so ants (wrong).
- 2^136, no, because the shoulder of 2 is the number of sides.
- Can we compress the search space in DP terms?
- Canât we just add and subtract one edge and make it work?
- A bipartite graph with edges taken from it is also bipartite
- Graphs that are connected and whose edges are added are also connected
- I donât know what to do with it since itâs both.
- Official Explanation
- Good to the point where I thought of it as a consolidated bipartite graph.
- I have no idea even after looking at the official explanation.
This page is auto-translated from /nishio/ARC105 using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. Iâm very happy to spread my thought to non-Japanese readers.