当前位置:网站首页>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.
边栏推荐
- Gbase JDBC connection database exception
- Data link layer protocol -- Ethernet protocol
- Apipost signs up with Chinatelecom! Work together to accelerate the digital transformation of enterprises
- tiny-emitter.js:一个小型的事件订阅发布库
- [analysis of GPIO register (crl/crh) configuration of STM32]
- Database design process
- PHP Baidu qianqianhua installment API
- Unity 之 UPR优化建议汇总
- [golang from introduction to practice] stone scissors paper game
- What is behind the development of science and technology now is the advent of the era of the meta universe
猜你喜欢
![[ CTF 学习 ] CTF 中的隐写集合 —— 图片隐写术](/img/32/2da78bd5866cfab9ee64dfcb1c1204.png)
[ CTF 学习 ] CTF 中的隐写集合 —— 图片隐写术

Unity 之 UPR优化建议汇总

ES6 -- Methods and extensions of array objects, traversal of arrays, and extension methods of strings

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

ESWC 2018 | R-GCN:基于图卷积网络的关系数据建模

Open source summer interview | "after 00" PMC member Bai Zeping

01 create project warehouse

GDT,LDT,GDTR,LDTR

OA and fansoft Bi cross system users, departments and posts synchronous summary

Database design process
随机推荐
Detailed explanation of security authentication of mongodb
Perspective
二、MySQL数据库基础
Swagger simple quick start tutorial
[golang from introduction to practice] stone scissors paper game
SMIC's revenue in 2018 was $3.36 billion, and 14nm technology was mass produced this year
LVGL 8.2 Slider
一般在进行数仓迁移过程中,是如何进行数据测试的?
How many rows does PostgreSQL need to partition for each table?
ES6 -- Methods and extensions of array objects, traversal of arrays, and extension methods of strings
# 1. Excel的IF函数
How can I check if the number of RDS links in MySQL suddenly rises?
Ora-01460: conversion request cannot be implemented or unreasonable
HTC new VR all-in-one machine vive focus plus release: price 5699 yuan!
Gbase 8A about no suitable driver
LVGL 8.2 Tabview & Window
自然的状态最好
Wechat official account all article download links to get
[wechat applet] design and interactive implementation of auction product details page (including countdown and real-time update of bids)
Grafana visual configuration diagram histogram