当前位置:网站首页>[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
边栏推荐
- 870. Approximate number
- Istio II traffic hijacking process
- Getting started with COM programming 1- creating projects and writing interfaces
- Leetcode 48 rotating image (horizontal + main diagonal), leetcode 221 maximum square (dynamic programming DP indicates the answer value with ij as the lower right corner), leetcode 240 searching two-d
- [msp430g2553] graphical development notes (2) system clock and low power consumption mode
- Get the current time in go language, and the simple implementation of MD5, HMAC, SHA1 algorithms
- Click the button to return to the top smoothly
- Leetcode 300 longest increasing subsequence (greedy + binary search for the first element subscript smaller than nums[i]), leetcode 200 island number (deep search), leetcode 494 target sum (DFS backtr
- Maya coffee machine modeling
- SSL Error: Unable to verify the first certificate
猜你喜欢

Stop using UUID indiscriminately. Have you tested the performance gap between self incrementing ID and UUID?

Maya coffee machine modeling

What should Ali pay attention to during the interview? Personal account of Alibaba interns who passed five rounds of interviews
![[msp430g2553] graphical development notes (1) configuration environment](/img/42/479c96d1e7f6747f893d1a0b65be3f.png)
[msp430g2553] graphical development notes (1) configuration environment
![[training Day9] light tank [dynamic planning]](/img/69/e7a69972a2865408479c7f8c245c1f.png)
[training Day9] light tank [dynamic planning]

TCP sliding window, singleton mode (lazy and hungry) double checked locking / double checked locking (DCL)

【LeetCode】1184. 公交站间的距离

Xiaomi 12s ultra products are so powerful, but foreigners can't buy Lei Jun: first concentrate on the Chinese market

Usage and introduction of MySQL binlog
![[training Day8] interesting number [digital DP]](/img/39/caad2ccff916d5ab0f8c3d93f3901d.png)
[training Day8] interesting number [digital DP]
随机推荐
Microservice architecture | service monitoring and isolation - [sentinel] TBC
Duilib actual combat 1- imitate Baidu online disk login interface
Mysql8 doesn't seem to support MyISAM partition tables. Does polardb-x support MyISAM partition tables?
2019 Hangdian multi school first 6581 vacation [thinking]
Expression evaluation (stack)
[training Day10] point [enumeration] [bidirectional linked list]
[FreeRTOS] 10 event flag group
How to view the execution plan of a stored procedure in Youxuan database
Get the current time in go language, and the simple implementation of MD5, HMAC, SHA1 algorithms
The difference between delete, truncate and drop in MySQL
Lunch break train & problem thinking: thinking about the problem of converting the string formed by hour: minute: second to second
From code farmer to great musician, you only need these music processing tools
Pix2seq: Google brain proposes a unified interface for CV tasks!
Do you want to enroll in a training class or study by yourself?
ATL container - catlmap, crbmap
Batch download files from the server to the local
[leetcode] 1184. Distance between bus stops
Virtual machine win7 system installation vmtool
Richview table table alignment
Leetcode 206 reverse linked list, 3 longest substring without repeated characters, 912 sorted array (fast row), the kth largest element in 215 array, 53 largest subarray and 152 product largest subarr