
搜索
淡蓝色的狼
这个作者很懒,什么都没留下…
展开
-
剑指 Offer 13. 机器人的运动范围
剑指 Offer 13. 机器人的运动范围原创 2021-12-28 21:37:57 · 157 阅读 · 0 评论 -
给出N个点,M条无向边,保证现在每个点的度至少为K,让我们找到一个长度大于K+1的环
直接搜索即可Codeforces 263D Cycle in Graph#include<iostream>#include<bits/stdc++.h>using namespace std;const int maxn=100000*4;struct node{ int v,nxt;}edge[maxn*4];int cnt=0;i...原创 2018-07-29 17:15:54 · 1970 阅读 · 0 评论 -
poj 1753
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;char mapp[5][5];int book[5][5];int mm=0;int answer=17;void fan(int x,int y){...原创 2018-06-03 18:37:45 · 235 阅读 · 0 评论 -
2018.06.03
poj 2488#include<cstdio>#include<cstring>#include<iostream>using namespace std ;int dix[] = {-1,1,-2,2,-2,2,-1,1} ;int diy[] = {-2,-2,-1,-1,1,1,2,2} ;const int maxn = 69 ;...原创 2018-06-03 17:03:46 · 209 阅读 · 0 评论 -
第六题: 方格填数
如下的10个格子(如果显示有问题,也可以参看【图1.jpg】)填入0~9的数字。要求:连续的两个数字不能相邻。 (左右、上下、对角都算相邻)一共有多少种可能的填数方案?请填写表示方案数目的整数。 注意:你提交的应该是一个整数,不要填写任何多余的内容或说明性文字。这个题目题目有点表述不明,不知道0~9 可不可以重复使用。我当时做的时候是当作不可以重复使用来处理的。那么这里我就...原创 2018-03-20 08:48:38 · 1144 阅读 · 0 评论 -
24点游戏
以下的这一篇文章不考虑精度的。。 考虑精度的需要列出所有的情况搜索。。没有写。。问你是否通过加减乘除括号构成24点。第一行t,表示有多少组测试数据,1<=t<=50 接下来t行,每行4个数字,表示每个数都是多少,1<=a[i]<=13 Output对于每一次询问,如果能够凑成24点,输出yes,否则输出no Sample Input2 3 3 8 8 1 1 1 1 Sample Ou原创 2017-10-25 20:40:38 · 422 阅读 · 0 评论 -
dfs CodeForces - 764C
Each New Year Timofey and his friends cut down a tree of n vertices and bring it home. After that they paint all the n its vertices, so that the i-th vertex gets color ci.Now it’s time for Timofey birt原创 2017-10-25 20:36:17 · 275 阅读 · 0 评论 -
吝啬的国度
就是暴力搜索即可 dfs+链式前向星题目链接<-点击#include<cmath>#include<iostream>#include<cstdio>#include<cstring>using namespace std;int pre[100005],head[100005];int cnt=0;struct edge{ int v,next;}edge[100005原创 2017-08-23 20:58:14 · 217 阅读 · 0 评论 -
D - Maze
思维搜索Pavel loves grid mazes. A grid maze is an n × m rectangle maze where each cell is either empty, or is a wall. You can go from one cell to another only if both cells are empty and have a common side原创 2017-07-25 19:04:41 · 402 阅读 · 0 评论 -
C - Prime Ring Problem
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. Note: the number of firs原创 2017-07-25 19:03:31 · 211 阅读 · 0 评论 -
B - Catch That Cow
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,00原创 2017-07-25 19:02:22 · 209 阅读 · 0 评论 -
A - Oil Deposits
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the原创 2017-07-25 19:01:24 · 250 阅读 · 0 评论 -
奇偶剪枝
经典小狗捡骨头#include<bits/stdc++.h>using namespace std;char a[10][10];int sx,sy,ex,ey;int dir[4][2]={0,1,1,0,0,-1,-1,0};void dfs(int x,int y,int time);int book[10][10],n,m,flag,t;int main (){ wh原创 2017-06-18 00:52:06 · 180 阅读 · 0 评论 -
搜索中的记录步数
显示路径 poj.3984#include<cstdio>#include<cstring>#include<iostream>#include<queue>using namespace std;int map[10][10],book[10][10];int dir[4][2]={0,1,1,0,0,-1,-1,0};struct node{ int x,y,step;原创 2017-06-18 00:50:24 · 319 阅读 · 0 评论 -
C - Ignatius and the Princess I
C - Ignatius and the Princess I The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess.原创 2017-05-26 12:23:56 · 277 阅读 · 0 评论 -
Nightmare
Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explodes.原创 2017-05-26 12:43:48 · 673 阅读 · 0 评论