当前位置:网站首页>search--01
search--01
2022-08-10 12:06:00 【51CTO】
题目大概:
There are many lines connecting multiple routers,Signals cannot be the same between connected routers,Ask at least several signals.
思路:
This is actually a coloring problem in high school.
There are many connected graphs in one plane,Each two connected graphs have a different color,Ask the minimum number of colors that can be used to paint the picture.
Here is the four-color theorem,That's four colors at most.
那就好办了,Cycle from one color,Starts painting each time a certain number of colors are given,开始递归,Paint from the first,And automatically determine whether it is adjacent to it and he is the same color,是则结束,不是则继续,when the color runs out,Not finished painting yet.When all painted,结束.
感想:
Plus a deep search for the four-color theorem.
代码:
边栏推荐
- Nocalhost - 让云原生时代的开发更高效
- LeetCode 82. Remove Duplicate Elements in Sorted List II
- Ssm framework construction process [easy to understand]
- LeetCode 61. 旋转链表
- What are some useful performance testing tools recommended? Performance testing report charging standards
- LeetCode 21. Merge two ordered linked lists
- 7、Instant-ngp
- 力扣练习——56 寻找右区间
- 制品库是什么?
- Buckle Exercise - 61 Sort by frequency of characters
猜你喜欢
How to join We Media, learn about these 5 monetization modes, and make your account quickly monetize
基于UiAutomator2+PageObject模式开展APP自动化测试实战
StoneDB Document Bug Hunting Season 1
可视化服务编排在金融APP中的实践
态路小课堂丨如何为CXP光模块选择光纤跳线?
一文详解 implementation api embed
Analysis of the implementation principle of UUID from the perspective of source code
Flutter气泡框实现
7、Instant-ngp
制品库是什么?
随机推荐
机器学习之暴力调参案例
Licking Exercise - 60 Maximum key-value sum of binary search subtrees
VSCode远程连接服务器报错:Could not establish connection to “xxxxxx”的可能错误原因及解决
codevs 2370 小机房的树 (LCA)
LeetCode 21. Merge two ordered linked lists
开源的作者,也有个生活问题
LCD驱动端与设备端名称匹配过程分析(Tiny4412)
Database management tool: dynamic read-write separation
Network Fundamentals (Section 1)
微信小程序,全局变量一个地方改变了其他地方的状态也跟着改变。
LeetCode 92. 反转链表 II
推荐6个自媒体领域,轻松易上手
因为找不到lombok而找不到符号log
有哪些好用的性能测试工具推荐?性能测试报告收费标准
3款不同类型的自媒体免费工具,有效提高创作、运营效率
暑期总结4
LeetCode 25. K 个一组翻转链表
Licking Exercise - 58 Verifying Binary Search Trees
Excel函数公式大全—HLOOKUP函数
HDU 4372:Count the Buildings (Stirling数)