当前位置:网站首页>[learning notes] agc008
[learning notes] agc008
2022-07-24 20:22:00 【Ants looking up at the starry sky】
Tetromino Tiling
Black Radius
- Clever topic
- sb Translation makes me think for a long time
- set up f ( x , d ) f(x,d) f(x,d) Represents the distance x x x Less than or equal to d d d Set of points for
- If f ( x , d 1 ) = f ( y , d 2 ) f(x,d1)=f(y,d2) f(x,d1)=f(y,d2)
- So for any x → y x\to y x→y Points on the path z z z, There is d d d Satisfy f ( z , d ) = f ( x , d 1 ) = f ( y , d 2 ) f(z,d)=f(x,d1)=f(y,d2) f(z,d)=f(x,d1)=f(y,d2)
- also d d d Value is V V V Type ( It's really hard to prove qwq
- Prove that f ( x , d ) f(x,d) f(x,d) Uniqueness
- So for some isomorphic f ( x , d ) f(x,d) f(x,d), We only in d d d Count at the lowest value
- If d d d The smallest is the smallest , Then it should be satisfied for arbitrary and x x x The adjacent y y y, f ( x , d ) ≠ f ( y , d − 1 ) f(x,d)\ne f(y,d-1) f(x,d)=f(y,d−1)
- set up s z [ x ] sz[x] sz[x] From x x x The longest starting chain length , s z 2 [ x ] sz2[x] sz2[x] From x x x The length of the next long chain
- m x [ x ] mx[x] mx[x] Representation node x x x The biggest legal d d d
- that m x [ x ] = min ( s z [ x ] − 1 , s z 2 [ x ] + 1 ) mx[x]=\min(sz[x]-1,sz2[x]+1) mx[x]=min(sz[x]−1,sz2[x]+1)
- The answer is ∑ ( m x [ x ] + 1 ) + 1 \sum{(mx[x]+1)}+1 ∑(mx[x]+1)+1
- What if only some points can be used as roots
- Consider for those smallest d d d, Find the best alternative
- It's not hard to find out d d d Monotonicity
- set up l w [ x ] lw[x] lw[x] Representation node x x x The smallest one can find a substitute d d d
- If f ( x , d ) f(x,d) f(x,d) Can find alternative points , Then exist and x x x The adjacent y y y, Satisfy f ( x , d ) = f ( y , d + 1 ) f(x,d)=f(y,d+1) f(x,d)=f(y,d+1)
- that l w [ x ] = min y ∈ s o n [ x ] ( max ( s z [ y ] + 1 , l w [ y ] − 1 ) ) lw[x]=\min_{y\in son[x]}(\max(sz[y]+1,lw[y]-1)) lw[x]=miny∈son[x](max(sz[y]+1,lw[y]−1))
- Obviously we need to change the root
- And then it's done
- The answer is ∑ ( m x [ x ] − l w [ x ] + 1 ) + 1 \sum(mx[x]-lw[x]+1)+1 ∑(mx[x]−lw[x]+1)+1
- Complexity O ( n ) O(n) O(n)
Division into Two
pull oneself together- Ingenious restrictions on transformation
- You might as well Abstract any scheme into a 01 01 01 Sequence
- Direct transfer is disgusting
- Rather give up direct transfer
- Might as well set A ≥ B A\ge B A≥B
- First, according to the pigeon nest principle , For any i ≥ 3 i\ge 3 i≥3 Yes s [ i ] − s [ i − 2 ] ≥ B s[i]-s[i-2]\ge B s[i]−s[i−2]≥B
- With this property, we can transfer
- d p [ i ] dp[i] dp[i] Before presentation i i i Number , The first i i i The number is X X X Number of schemes in the set
- Obviously legal transfer [ l , r ] [l,r] [l,r] You can use prefixes and optimizations
- Complexity O ( n ) O(n) O(n)
Rectangle
- Pigeon nest principle construction
- It should not be difficult
- Obviously, we need to estimate the range
Sequence Growing Easy
Sequence Growing Hard
边栏推荐
- Browser local storage webstroage
- Solve the problem of error l6218e undefined symbol XXX
- Unity3d eventsystem (event)
- Valdo2021 - vascular space segmentation in vascular disease detection challenge (2)
- Leetcode 146: LRU cache
- Each blogger needs to ask himself seven basic questions
- API data interface for historical data of A-share index
- [training Day10] point [enumeration] [bidirectional linked list]
- vlan技术
- [training Day10] tree [interval DP]
猜你喜欢

Elastomer simulation (elasticity)
![2019 Hangdian multi school first 6581 vacation [thinking]](/img/38/5a74d3ef346d6801f9da8fd3a4b23a.png)
2019 Hangdian multi school first 6581 vacation [thinking]

Machine learning job interview summary: five key points that resume should pay attention to

Valdo2021 - vascular space segmentation in vascular disease detection challenge (3)

Apache atlas version 2.2 installation
![[training Day8] tent [mathematics] [DP]](/img/d3/42869ed5bb7c9148d9fa7367a9af02.png)
[training Day8] tent [mathematics] [DP]

01 | 开篇词:手把手教你搭建一个博客网站

Connect the smart WiFi remote control in the home assistant

Markdown to PDF API data interface

Introduction to WDK development 1- basic environment construction and the first driver (VS2010)
随机推荐
Inconsistent time
Introduction and advanced tutorial of Albert duilib
Click the button to return to the top smoothly
ATL container - catlmap, crbmap
Functional test of redisgraph multi active design scheme
Write a batch and start redis
YouTube "label products" pilot project launched
[training Day8] interesting number [digital DP]
[training Day8] [luogu_p6335] staza [tarjan]
Unity2d~ game practice of decrypting Zhou mu (completed in three days)
Microservice architecture | service monitoring and isolation - [sentinel] TBC
Understand the domestic open source Magnolia license series agreement in simple terms
Mass modify attribute values in objects in JS
A circle is displayed and can be moved
Read the registry through the ATL library clegkey (simple and convenient)
API data interface of A-share transaction data
C form application treeview control use
[training Day8] tent [mathematics] [DP]
Huawei set up login with account and password
[FreeRTOS] 10 event flag group