摘要:BFS、DFS复杂度分析(时间、空间) https://blog.csdn.net/qq_41705423/article/details/107370669 一、BFS的复杂度分析 BFS是一种借用队列来存储的过程,分层查找,优先考虑距离出发点近的点。无论是在邻接表还是邻接矩阵中存储,都需要借助一
阅读全文
摘要:1 #include 2 const int N=1000010; 3 int cnt,head[N],n; 4 int size[N],num[N]; 5 void init() 6 { 7 cnt = 0; 8 for(int i =0;i<N;i++) head[i]=-1; 9 } 10 struct Node{ 11 int...
阅读全文
摘要:1 #include <iostream> 2 #include <algorithm> 3 #include <cstdio> 4 #include <string> 5 #include <string> 6 #include <cstring> 7 #include <map> 8 #incl
阅读全文
摘要:1 LETTERS 2 Time Limit: 1000MS Memory Limit: 10000K 3 Total Submissions: 9298 Accepted: 4174 4 Description 5 6 A single-player game is played on a rectangular board divided in R ...
阅读全文
摘要:Oil Deposits Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 48366 Accepted Submission(s): 27816 Problem Description The GeoSurvComp geol...
阅读全文
摘要:在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将
阅读全文
摘要:Relative Relatives Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3886 Accepted: 1723 Description Today is Ted's 100th birthday. A few wee
阅读全文
摘要:In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl named "Sena" are playing a video game. The game system of this video
阅读全文
摘要:262144K After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nogaku show during the feast. To enjoy th
阅读全文
摘要:"Oh, There is a bipartite graph.""Make it Fantastic." X wants to check whether a bipartite graph is a fantastic graph. He has two fantastic numbers, a
阅读全文
摘要:You are a rich person, and you think your wallet is too heavy and full now. So you want to give me some money by buying a lovely pusheen sticker which
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 typedef long long ll; 15 #d...
阅读全文
摘要:1 // Legacy Code 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 typedef long long ll; ...
阅读全文