随笔分类 -  dfs

bfs dfs 复杂度
摘要:BFS、DFS复杂度分析(时间、空间) https://blog.csdn.net/qq_41705423/article/details/107370669 一、BFS的复杂度分析 BFS是一种借用队列来存储的过程,分层查找,优先考虑距离出发点近的点。无论是在邻接表还是邻接矩阵中存储,都需要借助一 阅读全文

posted @ 2022-07-09 17:25 cltt 阅读(462) 评论(0) 推荐(0) 编辑

树上dfs+思维
摘要: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... 阅读全文

posted @ 2019-04-08 00:00 cltt 阅读(115) 评论(0) 推荐(0) 编辑

dfs 的全排列
摘要:1 #include <iostream> 2 #include <algorithm> 3 #include <cstdio> 4 #include <string> 5 #include <string> 6 #include <cstring> 7 #include <map> 8 #incl 阅读全文

posted @ 2019-03-09 21:46 cltt 阅读(204) 评论(0) 推荐(0) 编辑

poj 1154
摘要: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 ... 阅读全文

posted @ 2019-03-08 16:36 cltt 阅读(127) 评论(0) 推荐(0) 编辑

hdu 1241
摘要: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... 阅读全文

posted @ 2019-03-08 15:24 cltt 阅读(76) 评论(0) 推荐(0) 编辑

poj 1321
摘要:在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将 阅读全文

posted @ 2019-03-08 10:43 cltt 阅读(83) 评论(0) 推荐(0) 编辑

poj 2021
摘要:Relative Relatives Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3886 Accepted: 1723 Description Today is Ted's 100th birthday. A few wee 阅读全文

posted @ 2018-11-04 22:09 cltt 阅读(190) 评论(0) 推荐(0) 编辑

ACM-ICPC 2018 徐州赛区网络预赛 B. BE, GE or NE
摘要: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 阅读全文

posted @ 2018-09-13 21:31 cltt 阅读(359) 评论(0) 推荐(0) 编辑

ACM-ICPC 2018 徐州赛区网络预赛 A. Hard to prepare
摘要: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 阅读全文

posted @ 2018-09-12 23:59 cltt 阅读(176) 评论(0) 推荐(0) 编辑

ACM-ICPC 2018 沈阳赛区网络预赛 F. Fantastic Graph
摘要:"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 阅读全文

posted @ 2018-09-08 19:05 cltt 阅读(838) 评论(1) 推荐(0) 编辑

ACM Changchun 2015 A. Too Rich
摘要: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 阅读全文

posted @ 2018-08-30 21:05 cltt 阅读(243) 评论(0) 推荐(0) 编辑

cf 1006E
摘要: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... 阅读全文

posted @ 2018-07-18 09:14 cltt 阅读(128) 评论(0) 推荐(0) 编辑

German Collegiate Programming Contest 2015
摘要: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; ... 阅读全文

posted @ 2018-07-14 16:06 cltt 阅读(142) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 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 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示