惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Darknet – Hacking Tools, Hacker News & Cyber Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
G
Google Developers Blog
宝玉的分享
宝玉的分享
爱范儿
爱范儿
Last Week in AI
Last Week in AI
U
Unit 42
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
D
DataBreaches.Net
Recent Commits to openclaw:main
Recent Commits to openclaw:main
雷峰网
雷峰网
T
The Exploit Database - CXSecurity.com
L
LangChain Blog
C
CERT Recently Published Vulnerability Notes
S
Schneier on Security
C
Cisco Blogs
MongoDB | Blog
MongoDB | Blog
G
GRAHAM CLULEY
Hacker News - Newest:
Hacker News - Newest: "LLM"
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 最新话题
D
Docker
K
Kaspersky official blog
Security Latest
Security Latest
博客园 - 【当耐特】
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Hacker News
The Hacker News
P
Privacy International News Feed
Microsoft Security Blog
Microsoft Security Blog
V2EX - 技术
V2EX - 技术
The Last Watchdog
The Last Watchdog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Martin Fowler
Martin Fowler
Latest news
Latest news
Project Zero
Project Zero
TaoSecurity Blog
TaoSecurity Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threat Research - Cisco Blogs
H
Heimdal Security Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Help Net Security
Help Net Security
A
Arctic Wolf
Cisco Talos Blog
Cisco Talos Blog
Engineering at Meta
Engineering at Meta
M
MIT News - Artificial intelligence

静静的小窝

在VPS服务器上面安装OpenClaw并使用OpenRouter的免费API的一些“坑” | Some "pits" about installing OpenClaw and using OpenRouter's free API on a VPS server 五年了啊 | Five years 一个奇怪的估算 | A strange estimation 虚拟直播之路2 | Living as a V 2 虚拟直播之路 | Living as a V AI 写代码?| AI coding? X静评1.1:谷歌,快成了?| XComment1.1 Is Google's Success Coming? X静评0.3:要精致吗?| XComment0.3 Be Dainty? X静评0.2:座位是购买的服务还是赠送的服务?| Xcomment0.2 A Bought Seat or A Gift Seat X静评0.1:一纸限令,毁掉一个政策?| XComment0.1 One Paper, One Dead Policy? hadoop 3.2.2 Cluster Setup | hadoop 3.2.2 的集群启动 894A题解|894A Solution VY223 Journal Smith’s death 第一次翻墙|first cross wall [题解]异或三角形|2021蓝桥杯国赛|xor triangle 2021年蓝桥杯|LanQiaoCup2021 参赛|Attending Contest 新旧|New and Old 去毛泽东旧居| visit MAO ZEDONG old house 拜登会团结美国吗|Will Biden unite the USA? 出生|Birth 背包问题|knapsack problem 冒泡排序与排序的稳定性|Bubble Sort and Stability 看完哔哩哔哩上的NASA的火星车直播后的一些话|My words after watching NASA's launch of the Mars 2020 perseverance rover live on Bilibili 选择排序|Selection Sort 饭圈与特郎普|fandom and Trump 不盲目|No Blindness 从3到n——一道数学题|a math problem from 3 to N 公权与私权|public and private rights 我在第几层|Where I Am 中国不是欧洲的救世主|China Will Not Save Europe 美国之行|A Travel To The USA 做一个真正的关注者|Pay true attention 云笔记|inote 闵行高三一模作文|Chinese Composition of First Minghang Mock Exam 一个诡异的脑洞|A strange idea 科学技术的发展离不开艺术 读后感——竞选州长 影评英伦对决——成龙的又一力作 影评2001:太空漫游——最好的科幻电影 关于航空航天探测工程的一点思考 科学营总结 2019科学营Day4 2019科学营Day3 2019科学营Day2 2019科学营Day1 研学中的思考 在研学中学习 北京研学Day1 洛谷P1000题解 探访商飞 读书笔记_2019年寒假 OK!
一道数学题|A Math Problem
静静 · 2020-03-13 · via 静静的小窝

一天遇到了一道题
点击图片查看大图

思考半天也不知道第三小问怎么做,幸好首项只有36种可能,枚举了[1,17]中的奇数就算出了答案,老师讲评时也用了枚举法算的,还画出了这幅图,让我有了一种图论题的感觉。

老师又让我们思考36改为其他数值的情况,然而我并不能想出来,又想到仿佛可以用图的方法做,于是就写了一段算了一下。结果如下:

这有什么规律吗?去问了老师,结果老师回复

是我想太多了。

好久没做过题了,也比较懒,数据量也不大,就比较暴力了,代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
int main()
{






int a[260][260];
int m;
for (int x=1;x<=100;x++)
{
int ans=0;
for (int i=1;i<=255;i++)
for (int j=1;j<=255;j++)
a[i][j]=1000;
for (int i=1;i<=2*x;i++)
{

int j;
if (i<=x) j=2*i;
else j=2*i-2*x;
a[i][j]=1;
}

for (int i=1;i<=2*x;i++)
{
for (int j=1;j<=2*x;j++)
{
for (int k=1;k<=2*x;k++)
{
a[j][k]=min(a[j][k],a[j][i]+a[i][k]);
}
}
}

for (int i=1;i<=2*x;i++)
{
for (int j=1;j<=2*x;j++)
{
if (a[i][j]!=1000) ans=max(ans,a[i][j]);
}
}
ans++;
m=2*x;
printf("%d %d\n",m,ans);
}
return 0;
}

解答最后有这么一段话:

事实上,规律是:
首项是整数时,第二项是偶数,第三项是4的倍数,任意一项不超过36
(1) 如果首项是3的倍数,那么由第二问的结论,每一项都是3的倍数,那么第三项是12的倍数,只能是12或24或36,于是由递推关系,第三项起最多2项,考虑前两项,M的元素最多4个,实际上M的元素个数可能是1或2或3或4
(2) 如果首项不是3的倍数,则M中的元素均不是3的倍数,所以第三项可能是4、8、16、20、28、32其中一项,那么以后形成这6项之间的循环,于是考虑前两项,M中元素最多8项,实际上M的元素个数可能是6或7或8
综上,M的元素个数最多为8个,当首项为1或5或7或11或13或17或19或23或25或29或31或35时取到。