当前位置:网站首页>2022-7-13 summary
2022-7-13 summary
2022-07-25 04:50:00 【JSU-YSJ】
The time for this summary is 2022-7-12~2022-7-13.
Summarize the learning algorithm :
1. I have deeply studied the game , In especial SG function . I know several key points :
(1)SG Expression of function :sg(x) = mex{1,2, 3...} = 0, Defined as the smallest integer that does not appear .
(2)SG Function table template and understanding : take SG Understand the relationship between function and binary , We define all 0 In a state of inevitable failure
00000000( Suppose eight digits ) So for a state 00000001 It can be removed 1 Let him become all 0 It is a winning state
We can use the value that needs to be removed ^ To get . For any state, he has any way to turn it into a state of failure
Then it is in a winning state .
Main transformation :( The problem of taking stones )
A and B Just as much ,A ^ B = 0 If you start, you'll lose
A - B - , A ^ B = 1 The first step is to win
A - B Defeat or A - B Defeat , A ^ B = 1 The first step is to win
A Defeat B Defeat A^B = 0 If you start, you'll lose
void get_sg() {
for (int i = 1; i < N; i++) {
if (i & 1 && !sg[i - 1]) {
sg[i] = 1;
continue;
}
for (int j = 1; j <= 10; j++) {
if (i >> j & 1) {
for (int k = 0; k < j; k++) {
if (!sg[i ^ (1 << j) ^ (1 << k)]) sg[i] = 1;
}
}
}
}
}
How to solve the problem , If you can't see it, type the watch first and then find the rule
2. Big prime judgement
Generally speaking, judge a number n Is it a prime number , You can use a root sign n The algorithm of . But when n Sometimes, for example :100000000000000000, It's impossible at this time , Need to adopt a new property to judge , Fermat's small Theorem .
The condition of Fermat's theorem is P Prime number , On the contrary, if Fermat's small theorem holds, then P Prime number . But this judgment will be a little mistaken , Therefore, we need to make a second depth judgment ( I don't understand it very well here. I have to look at it ).
Summarize the question brushing part :
Two garbage CF+ Supplementary questions :

Last year's winter vacation Niuke made up the question :




Game problem

Reading summary
Read the algorithm competition advanced graph theory 20 page ( Equivalent to review ), Look at the integer solution of the binary first-order equation (20 page ). There is an available corollary :
ax + by = n There is an integer solution ====> gcd(a,b) Divisibility n.
边栏推荐
- Druid connection pool - strong self-study from 0. Those who don't understand Druid can click in. If you know not to click in, you will think I'm wordy
- Open source summer interview | "after 00" PMC member Bai Zeping
- When the development of the meta universe begins to show more and more the style of the Internet, we need to be vigilant
- Network engineering case: integrated network design of CII company
- The interviewer asked MySQL transactions, locks and mvcc at one go. I
- How many rows does PostgreSQL need to partition for each table?
- MCU experiment record
- Actual combat | record an attack and defense drill management
- Get the parameters of the browser address bar
- What causes the wait event of TCP socket (kgas) in oracle?
猜你喜欢

Interviewer: explain the core principle of ThreadLocal

How to ensure data consistency between MySQL and redis?
![[golang from introduction to practice] stone scissors paper game](/img/bb/5a5cdb9228949d263dc7bf62e34d97.png)
[golang from introduction to practice] stone scissors paper game

Openworm project compilation

Zhongchuang computing power won the recognition of "2022 technology-based small and medium-sized enterprises"

Ffmpeg download and installation

Summary of UPR optimization suggestions of unity

Basic knowledge of scratch crawler framework

# 1. Excel的IF函数
![[analysis of GPIO register (crl/crh) configuration of STM32]](/img/63/a7b262e95f1dc74201ace9d411b46f.png)
[analysis of GPIO register (crl/crh) configuration of STM32]
随机推荐
Completed project series Tutorials - smart campus management system
How to test data in the process of data warehouse migration?
How to ensure data consistency between MySQL and redis?
[wechat applet] label (86/100)
[detailed tutorial] a thorough article on mongodb aggregation query
Apple airpower was forced to cancel its launch two years after it was launched! Uncover the reason!
Openworm project compilation
2、 Mysql database foundation
教你如何定位不合理的SQL?并优化之
If the development of the metauniverse still follows the development logic of the Internet, and its end point also follows
Gradle test and idea test
LVGL 8.2 Span
@Summary of ResponseBody annotation
Pyg builds GCN to realize link prediction
Paper:《Peeking Inside the Black Box: Visualizing Statistical Learning with Plots of Individual Condi
Unity3d learning note 9 - loading textures
5年经验的大厂测试/开发程序员,怎样突破技术瓶颈?大厂通病......
Anaconda installs jupyter
Apipost signs up with Chinatelecom! Work together to accelerate the digital transformation of enterprises
Network engineering case: integrated network design of CII company