随便写一下的搜索,别的OJ深搜就过了,强大的BZOJ成功栈溢出RE了我并使我屈服地用广搜过掉,第一行手动开栈惨遭无视。 广搜: 深搜:            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2021-07-15 15:34:34
                            
                                58阅读
                            
                                                                             
                 
                
                             
         
            
            
            
             
Description
 FGD小朋友特别喜欢爬山,在爬山的时候他就在研究山峰和山谷。为了能够让他对他的旅程有一个安排,他想知道山峰和山谷的数量。 给定一个地图,为FGD想要旅行的区域,地图被分为n*n的网格,每个格子(i,j) 的高度w(i,j)是给定的。 若两个格子有公共顶点,那么他们就是相邻的格子。(所以与(i,j)相邻的格子有(i−1, j−1),(i−1,j),(i−1,j+1),(            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2014-08-13 18:04:00
                            
                                51阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            1102: [POI2007]山峰和山谷GrzTime Limit: 10 SecMemory Limit: 162 MBSubmit: 436Solved: 227[Submit][Status]DescriptionFGD小朋友特别喜欢爬山,在爬山的时候他就在研究山峰和山谷。为了能够让他对他的旅...        Read More            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2014-09-16 19:02:00
                            
                                61阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            思路:用dfs 会爆栈,巨坑,要用bfs。            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2018-06-16 19:07:00
                            
                                29阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            js中数据类型 // Number 数值 整数 小数 // String 字符串 (字符) '单引号'或"双引号" // Boolean true/false // null 没有 // undefined 没有赋值就是他 未定义 // object 对象 类型 0.1+0.2结果为0.300000 ...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-11-02 18:26:00
                            
                                151阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            1.字体样式:font-size: 设置字体大小 font-weight: bold; 设置变粗 font-weight: lighter; 设置变细 font-style: italic;设置斜体 color: 设置颜色2、文本样式:text-decoration: underline;设置字体下 ...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-11-02 16:55:00
                            
                                79阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            题目大意:给定一张地势图,求山峰和山谷的数量直接Floodfill……注意DFS会爆栈,用BFS才能过#include #include #include #include #define M 1010using namespace std;int n,ans1,ans2,a[M][M];bool flag,v[M][M];/*void Floodfill(int x,i            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2023-04-19 00:35:50
                            
                                37阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            1.源代码#include#include #define maxn 100using namespace std;struct Node{	int left,right;		int root_flag = 1 ;//根标志 };int num;//结点总数 Node node[maxn];//二叉树节点 vector result;//存储遍历结果 //从字符转换            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-01-28 14:34:03
                            
                                25阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            1.源代码#include#include #define maxn 100using namespace std;struct Node{	int left,right;		int root_flag = 1 ;//根标志 };int num;//结点总数 Node node[maxn];//二叉树节点 vector result;//存储遍历结果 //从字符转换            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2021-07-08 14:16:30
                            
                                76阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            Description  FGD小朋友特别喜欢爬山,在爬山的时候他就在研究山峰和山谷。为了能够让他对他的旅程有一个安排,他想  知道山峰和山谷的数量。给定一个地图,为FGD想要旅行的区域,地图被分为n*n的网格,每个格子(i,j) 的高度w(  i,j)是给定的。若两个格子有公共顶点,那么他们就是相邻的格子。(所以与(i,j)相邻的格子有(i?1, j?1),(i?1  ,j),(i?1,j+1)            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-04-19 15:31:03
                            
                                83阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            #include#include#include#define N 100struct node {int x,y,dis;}road[N*N];int pre[N];int find(int n) {return pre[n]=n==pre[n]?n:find(pre[n]);}int cmp(c...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2013-10-30 18:48:00
                            
                                43阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            Constructing RoadsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10151Accepted Submission(s): 3782 Problem Description There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can c...        Read More            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2013-05-11 20:31:00
                            
                                69阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            我卧底五年成了老二,再卧底下去,我怕会成为老大! ...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-11-02 08:59:00
                            
                                72阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            
 1 class Solution(object):
 2     def maximumMinimumPath(self, A):
 3         """
 4         :type A: List[List[int]]
 5         :rtype: int
 6         """
 7         dire = [[0,1],[1,0],[-1,0],[0,-1            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2019-06-30 01:33:00
                            
                                43阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            模拟#include #include using namespace std;char numbers[10][5][3] = { { ' ', '-', ' ', '|', ' ', '|', ' ', ' ', ' ', '|', ...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2013-07-19 20:00:00
                            
                                46阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            1102. Invert a Binary Tree (25)
时间限制
400 ms
内存限制
65536 kB
代码长度限制
16000 B
判题程序
Standard
作者
CHEN, Yue
The following is from Max Howell @twi            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-08-30 09:57:14
                            
                                62阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            Constructing Roads Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14269    Accepted Submission(s): 543            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-12-02 00:35:18
                            
                                44阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            并查集+最小生成树Constructing RoadsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15844Accepted Submissio...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2015-05-01 12:15:00
                            
                                37阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            http://acm.hdu.edu.cn/showproblem.php?pid=1102 1 #include 2 #include 3 #include 4 #define maxn 1001 5 using namespace std; 6 const int inf=1<<30; 7...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2014-04-13 19:35:00
                            
                                24阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2020-04-28 16:24:00
                            
                                106阅读