![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索
【杰杰】
这个作者很懒,什么都没留下…
展开
-
Bubble Cup 14 - Finals Online Mirror (Unrated, ICPC Rules, Teams Preferred, Div. 2) J. Robot Factory
传送门题意:给你一个矩阵,矩阵中的每一个数的二进制串可以表示出该位置周围的围墙信息,让你求出所有的房间大小。思路:建图,搜索,一气呵成。#include<iostream>#include<string>#include<map>#include<bits/stdc++.h>#include<iomanip>#include<algorithm>#define ll long longusing namespa原创 2021-10-21 21:36:21 · 343 阅读 · 0 评论 -
杭电7- Link with Limit
传送门思路:dfs寻找所有的环的平均值。#include<cstdio>#include<iostream>#include<cstring>#define ll long longusing namespace std;double a[100010];int vis[100010];double sum[100010];int cnt = 0,flag = 0;double ans = 0;void dfs(int x){ if(vis原创 2021-08-12 17:23:06 · 147 阅读 · 0 评论 -
杭电多校3-Segment Tree with Pruning
传送门题意:用题目所给的方法构建二叉树,求这颗二叉树的节点数。思路:采用记忆化搜索,设tree[r]tree[r]tree[r]为第r个节点下面含有的节点数,这样在后面遇到r时可以直接调用值。#include<bits/stdc++.h>using namespace std;#define ll long longmap<ll,ll>tree;ll k;ll build(ll r){ if(r <= k)return 1; if(tree[r])r原创 2021-07-28 21:06:35 · 121 阅读 · 0 评论 -
好奇怪的游戏
传送门#include<bits/stdc++.h>using namespace std;int a[12]={1,1,2,2,2,2,-1,-1,-2,-2,-2,-2};int b[12]={-2,2,-2,-1,1,2,-2,2,-1,1,-2,2};struct node{ int x,y,step;};queue<node>q;int vis[50][50];int bfs(int x1,int y1,int ans){ while(!q.emp原创 2021-04-28 23:29:24 · 110 阅读 · 0 评论 -
Solve The Maze
Vivek has encountered a problem. He has a maze that can be represented as an n×m grid. Each of the grid cells may represent the following:Empty — ‘.’Wall — ‘#’Good person — ‘G’Bad person — ‘B’The only escape from the maze is at cell (n,m).A person c原创 2021-03-12 20:45:33 · 256 阅读 · 0 评论 -
Q - 迷宫寻宝
洪尼玛今天准备去寻宝,在一个n*n (n行, n列)的迷宫中,存在着一个入口、一些墙壁以及一个宝藏。由于迷宫是四连通的,即在迷宫中的一个位置,只能走到与它直接相邻的其他四个位置(上、下、左、右)。现洪尼玛在迷宫的入口处,问他最少需要走几步才能拿到宝藏?若永远无法拿到宝藏,则输出-1。Input多组测试数据。每组数据输入第一行为正整数n,表示迷宫大小。接下来n行,每行包括n个字符,其中字符’.‘表示该位置为空地,字符’#'表示该位置为墙壁,字符’S’表示该位置为入口,字符’E’表示该位置为宝藏,输入数原创 2021-03-11 16:24:05 · 199 阅读 · 0 评论 -
赛前突击训练——分解因数
给出一个正整数a,要求分解成若干个正整数的乘积,即a = a1 * a2 * a3 * … * an,并且1 < a1 <= a2 <= a3 <= … <= an,问这样的分解的种数有多少。注意到a = a也是一种分解。Input第1行是测试数据的组数n,后面跟着n行输入。每组测试数据占1行,包括一个正整数a (1 < a < 32768)Outputn行,每行输出对应一个输入。输出应是一个正整数,指明满足要求的分解的种数思路:dfs#include原创 2021-03-09 18:46:17 · 139 阅读 · 0 评论