CCPC24 Harbin Solution Set
Otomachi_Una_ · · 个人记录
由于某种原因,我藏起来了原来自己写的中文题解。需要的同学可以私信我。
Feeling pretty good about this game, ah, got the questions roughly filled in.
Gave a quality scoring system of my own:
Scoring - Defense - Milk Dragon - okay - smart - -Goddess - can't make it up
Will only rate questions that I don't find that easy. It's important to note that mending not moving doesn't mean it's any more godly than a godly question.
For example, many Ynoi questions I would consider to be scored and mended.
Problem A. Build a Computer
Build an automaton that recognizes all the numbers in
[L,R] .
Score: milky dragon.
If you've studied a bit of automata theory, you know to go ahead and build a trie first, and merge two trie nodes if they both get the same state by going the same way. Just maintain it with a tree hash.
It's even done with minimal nodes.
Problem B. Concave Hull
Find the concave bag with the largest area.
Score: milking the dragon.
Feel like I'm sugar pilling.
You start by building a convex bag
Scan the line for the edge of
Problem C. Giving Directions in Harbin
Simulation.
Problem D. A Simple String Problem
Find the longest
AA string in a grid of characters2\times n , each time the path goes down or right.
Score: Clever.
Consider the
Then the case of
Time complexity:
Problem E. Marble Race
Given a table of
n\times m numbers. Guarantee thatn is odd. Take one at random from each row and find the expectation of the median.
Score: Clever.
Enumerate
It can be straightforward to dp or generate a function assuming there are
Consider that only the pair
Time complexity:
Problem F. 1D Galaxy
Score: complementary immobility.
Problem G. Welcome to Join thr Online Meeting
Direct dfs is fine.
Problem H. Subsequence Counting
Define
s to be a sequence ofn (l,v) denotingl numbersv stitched together. LetL=\sum l_i .Define
s' to satisfys'_{ki\bmod L}=s_i . Find the number ofs' neutron sequences that aret .
Score: gods.
Suppose
You first write it in matrix multiplication form, then we are asking for
Remember the form
- If
2d>k . We invertM in all but the first place to getM' . Then there is clearlyf(k,d,M)=f(k,k-d,M') . - Instead, we can divide these things
d into segments and stack them to form a? rectangle ofd rows andd columns. Then\prod M is actually some sort of sequential right-multiplication of the entire column. So if we can find the composition of each column's consecutive segmentsN we havef(k,d,M)=f(d,d-k\bmod d,N) . Here the process of finding each column of consecutive segments is easy to maintain using a line tree. Easy to state:|N|\leq |M|+\mathcal O(1) .
Time complexity:
Problem I. A Brand New Geomatric Problem
Given a reproducible set
S , you can perform two operations:
- Delete a number;
- add a number;
Given
a=\sum S andb=\prod S . Find the minimum operand.
RATING: Godsend.
We need only consider
First
You find out that the burst search is actually quick for
So, we do a dp on
Time complexity:
Problem J. New Energy Vehicles
Score: not bad.
Greedy for a bit.
Problem K. Farm Management
Rating: okay.
Greed is gone.
Problem L. A Game On Tree
dfs Gone in two swipes.
Problem M. Weird Ceiling
Check in.