
搜索
pullulate_99
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【dfs】POJ-2488-A Knight's Journey
A Knight's Journey Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 48296 Accepted: 16393 Description Background The knight is getting bored of seeing t原创 2018-02-02 11:58:59 · 223 阅读 · 0 评论 -
POJ1040-Transportation【dfs】
思路 设最大收入为best 初始值为0 订单数为Count orders[i].from:起始站 orders[i].to:目的地站 orders[i].passengers订单的人数 orders[i].price订单价格 orders[i].remaining剩余订单价格(接受剩余订单) 约束条件: 枚举订单K途径的每个火车站i 判断是否超载 #include <iostream>...原创 2019-01-21 16:04:46 · 332 阅读 · 0 评论 -
POJ2258 The Settlers of Catan【dfs】
道路用a[i][j]表示 vis[i][j] :表示用过 dfs遍历递归 寻找最长的长度 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int m,n; int a[30][30]; int vis[30][30]; int ans; void dfs(int...原创 2019-01-20 12:05:19 · 327 阅读 · 0 评论 -
POJ - 3620-Avoid The Lakes 【DFS】
Avoid The Lakes POJ - 3620 Farmer John’s farm was flooded in the most recent storm, a fact only aggravated by the information that his cows are deathly afraid of water. His insurance agency will onl...原创 2018-02-19 20:54:11 · 207 阅读 · 0 评论 -
HDU-1010-Tempter of the Bone【DFS剪枝】
Tempter of the Bone Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ...原创 2018-02-28 16:07:58 · 294 阅读 · 0 评论 -
哈理工OJ1621_迷宫问题II【BFS+优先队列】
迷宫问题II Time Limit: 1000 MS Memory Limit: 32768 K Total Submit: 366(113 users) Total Accepted: 139(92 users) Rating: Special Judge: No Description 小z身处在一个迷宫中,小z每分钟可以走到上下左右四个方向的相邻格之一。迷宫中有一些...原创 2018-02-18 15:10:01 · 459 阅读 · 0 评论 -
哈理工OJ-1326-Leyni的国家
Leyni经过了若干年的征战,终于建立了自己的国家,这个国家包含n个城市,编号为1到n。城市c是首都,每条城市中的路都是双向的,而且从首都到每个城市都只存在一条路线。 在Leyni的国家,他使用一种奇怪的方式来描述地图:对每一个非首都城市记录了一个数字pi,代表着从首都到城市i的路线中在到达城市i之前经过的最后一个城市的编号。 但是现在,Leyni计划将首都由城市c改为城市k,所以需要你按照他...原创 2018-03-07 23:11:10 · 360 阅读 · 0 评论 -
2018年全国多校算法寒假训练营练习比赛(第四场)-A-石油采集
随着海上运输石油泄漏的问题,一个新的有利可图的行业正在诞生,那就是撇油行业。如今,在墨西哥湾漂浮的大量石油,吸引了许多商人的目光。这些商人们有一种特殊的飞机,可以一瓢略过整个海面20米乘10米这么大的长方形。(上下相邻或者左右相邻的格子,不能斜着来)当然,这要求一瓢撇过去的全部是油,如果一瓢里面有油有水的话,那就毫无意义了,资源完全无法利用。现在,商人想要知道,在这片区域中,他可以最多得到多...原创 2018-02-14 15:07:46 · 352 阅读 · 0 评论 -
2018年全国多校算法寒假训练营练习比赛(第四场)F-Call to your teacher
链接:https://www.nowcoder.com/acm/contest/76/F 来源:牛客网 题意: 问1号能不能找到n号 n个点,m个边 示例1 输入 5 5 1 3 2 3 3 4 2 4 4 5 输出 Yes 示例2 输入 4 3 1 2 2 3 4 1 输出 No #include<bits/stdc++.h> using...原创 2018-02-11 23:15:26 · 336 阅读 · 0 评论 -
2018年全国多校算法寒假训练营练习比赛(第四场)H-全排列
DFS深搜全排列 1—-8 #include<stdio.h> #include<string.h> #include<math.h> const int maxn=1000; int a[maxn],book[maxn],n,ans=0; void dfs(int step) { int i; if(step==9) { ...原创 2018-02-11 23:12:20 · 243 阅读 · 0 评论 -
【BFS】哈理工OJ-2074-逃生
逃生 Description 小A沦落到了一个迷宫之中,这个迷宫由n*m个格子构成,有些格子是不能通过的,现在他要从迷宫入口(1,1)的格子走到迷宫出口(n,m)的格子。 因为小A的方向感很弱,转多了会晕,所以他走到目的地的时候,最多能转z次,否则他就永远晕倒在原地了,到了出口也没法出去了。 请你告诉他最少能经过多少个格子走出迷宫。小Y从(1,1)出发到达的原创 2018-01-21 01:29:17 · 695 阅读 · 0 评论 -
HDU-1241-Oil Deposits【DFS深度搜索模版题】
Oil Deposits Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a t原创 2018-01-20 21:25:19 · 259 阅读 · 0 评论 -
HDU 2952 Counting Sheep(搜索题目)
Counting Sheep Problem Description A while ago I had trouble sleeping. I used to lie awake, staring at the ceiling, for hours and hours. Then one day my grandmother suggested I tried counting sheep原创 2018-02-04 13:54:00 · 362 阅读 · 0 评论 -
记忆化搜索POJ-1088(dfs+dp)
#include #include #include #include #include using namespace std; int dp[1111][1111]; int r,c; int a[1111][1111]; int dir[4][2]= {{0,1},{1,0},{0,-1},{-1,0}}; int dfs(int x,int y) { int nex,ney;原创 2018-02-03 14:36:39 · 172 阅读 · 0 评论 -
POJ1315 Don't Get Rooked【DFS】
纯dfs #include <iostream> #include <cstdio> #include <iomanip> #include <string> #include <cstring> #include <cmath> #include <algorithm> #include <queu原创 2019-01-21 17:46:05 · 316 阅读 · 0 评论