搜索
还是太年轻
这个作者很懒,什么都没留下…
展开
-
CodeForce 986 C. AND Graph(dfs+位运算)
C. AND Graphtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a set of size mm with integer elements between 00 and 2n−12n−1 inclusive...原创 2018-06-18 10:08:17 · 340 阅读 · 0 评论 -
牛客练习赛12 (3次 bfs)
开始跑了一遍bfs发现不行,因为可能存在去拿钥匙在回来的情况,无法用数组标记。但是因为钥匙,起点,终点,门都各有一个,所以可以进行三次dfs。1.从起点到终点。2.从起点去拿钥匙。在从钥匙的地点到终点。这三次遍历都可以用mp数组标记,可以在规定时间内解决。代码:#includeusing namespace std;char t[505][505];bool mp[505]原创 2018-02-09 20:57:58 · 592 阅读 · 0 评论 -
HDU 1298 T9(字典树+DFS)
T9Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3524 Accepted Submission(s): 1316Problem DescriptionA while ago it was quite cumbersome to ...原创 2018-02-09 12:05:35 · 213 阅读 · 0 评论 -
HDU 2830 Matrix Swapping II(最大子矩阵续)
Matrix Swapping IITime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2155 Accepted Submission(s): 1438Problem DescriptionGiven a原创 2018-02-01 12:04:48 · 163 阅读 · 0 评论 -
HDU 2870 Largest Submatrix (找最大子矩阵)
Largest SubmatrixTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2682 Accepted Submission(s): 1316Problem DescriptionNow here原创 2018-02-01 11:14:16 · 175 阅读 · 0 评论 -
POJ 3050 Hopscotch
HopscotchTime Limit: 1000MS Memory Limit: 65536KTotal Submissions:4853 Accepted: 3212DescriptionThe cows play the child's game of hopscotch in a non-traditional原创 2018-02-03 17:20:16 · 148 阅读 · 0 评论 -
POJ 3187 Backward Digit Sums
Backward Digit SumsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions:8357 Accepted: 4764DescriptionFJ and his cows enjoy playing a mental game. They writ原创 2018-02-03 16:39:56 · 98 阅读 · 0 评论 -
POJ 2718 Smallest Difference(dfs)
Smallest DifferenceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions:13974 Accepted: 3797DescriptionGiven a number of distinct decimal digits, you can fo原创 2018-02-03 16:04:53 · 149 阅读 · 0 评论 -
POJ 3669 Meteor Shower
Meteor ShowerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions:23249 Accepted: 6044DescriptionBessie hears that an extraordinary meteor shower is coming;原创 2018-02-03 14:30:01 · 190 阅读 · 1 评论 -
POJ 3009 Curling 2.0(dfs)
Curling 2.0Time Limit: 1000MS Memory Limit: 65536KTotal Submissions:23543 Accepted: 9505DescriptionOn Planet MM-21, after their Olympic games this year, curling原创 2018-02-03 13:40:38 · 117 阅读 · 0 评论 -
递归专项练习(递归求路径)汉诺塔问题
问题 F: 汉诺塔问题时间限制: 1 Sec 内存限制: 128 MB提交: 28 解决: 13[提交][状态][讨论版]题目描述约19世纪末,在欧州的商店中出售一种智力玩具,在一块铜板上有三根杆,最左边的杆上自上而下、由小到大顺序串着由64个圆盘构成的塔。目的是将最左边杆上的盘全部移到中间的杆上,条件是一次只能移动一个盘,且不允许大盘放在小盘的上面。这是一个著原创 2018-01-20 22:10:42 · 377 阅读 · 0 评论 -
递归专项训练(递归找元素)
问题 G: 判断元素是否存在时间限制: 1 Sec 内存限制: 128 MB提交: 59 解决: 38[提交][状态][讨论版]题目描述有一个集合M是这样生成的:(1) 已知k是集合M的元素; (2) 如果y是M的元素,那么,2y+1和3y+1都是M的元素;(3) 除了上述二种情况外,没有别的数能够成为M的一个元素。问题:任意给定k和x,请判断x是否是M的元素。原创 2018-01-20 22:16:40 · 1056 阅读 · 0 评论 -
2018年全国多校算法寒假训练营练习比赛(第四场)G-老子的意大利炮呢
链接:https://www.nowcoder.com/acm/contest/76/G来源:牛客网题目描述 自攻打过太原县城以后,李云龙这意大利炮就使用的越发的顺手了,指哪打哪也是绝不含糊,于是小野队长开始疯狂打击独立团炮兵营,为了锻炼士兵移动意大利炮的能力,李团长开始给炮兵营进行特训,众(wo)所(xia)周(bian)知(de),意大利炮可由炮管,车轮,炮弹三部分组成,现在李团长在洋村设立...原创 2018-02-26 17:41:50 · 293 阅读 · 0 评论 -
codeforce 507E Breaking Good
E. Breaking Goodtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBreaking Good is a new video game which a lot of gamers want to have. There is a c...原创 2018-04-20 11:06:21 · 192 阅读 · 0 评论 -
2018年东北农业大学春季校赛 H-why的吃鸡 (bfs)
链接:https://www.nowcoder.com/acm/contest/93/H来源:牛客网题目描述 最近吃鸡游戏非常火,你们wyh学长也在玩这款游戏,这款游戏有一个非常重要的过程,就是要跑到安全区内,否则就会中毒持续消耗血量,我们这个问题简化如下 假设地图为n*n的一个图,图中有且仅有一块X的联通快代表安全区域,有一个起点S代表缩圈的时候的起点,图中C代表的是车(保证车的数量小...原创 2018-04-07 10:14:21 · 453 阅读 · 2 评论 -
ZOJ 3805 Machine(dfs)
MachineTime Limit: 2 Seconds Memory Limit: 65536 KBIn a typical assembly line, machines are connected one by one. The first machine's output product will be the second machine's raw material. To ...原创 2018-04-17 22:57:31 · 203 阅读 · 0 评论 -
codeforce -39E-What Has Dirichlet Got to Do with That?(博弈+dfs)
E. What Has Dirichlet Got to Do with That?time limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputYou all know the Dirichlet principle, the point of which ...原创 2018-04-11 15:38:09 · 208 阅读 · 0 评论 -
埃森哲杯第十六届上海大学程序设计联赛春季赛暨上海高校金马五校赛 B-合约数(dfs序)
链接:https://www.nowcoder.com/acm/contest/91/B来源:牛客网题目描述 在埃森哲,员工培训是最看重的内容,最近一年,我们投入了 9.41 亿美元用于员工培训和职业发展。截至 2018 财年末,我们会在全球范围内设立 100 所互联课堂,将互动科技与创新内容有机结合起来。按岗培训,按需定制,随时随地,本土化,区域化,虚拟化的培训会让你快速取得成长。小埃希望能通...原创 2018-04-16 11:57:42 · 225 阅读 · 0 评论 -
牛客练习赛13 E-龟兔跑步
链接:https://www.nowcoder.com/acm/contest/70/E来源:牛客网题目描述有一只乌龟,初始在0的位置向右跑。 这只乌龟会依次接到一串指令,指令T表示向后转,指令F表示向前移动一个单位。乌龟不能忽视任何指令。 现在我们要修改其中正好n个指令(一个指令可以被改多次,一次修改定义为把某一个T变成F或把某一个F变成T)。 求这只乌龟在结束的时候离起点的最远距离。(假设乌龟...原创 2018-03-18 19:02:13 · 262 阅读 · 0 评论 -
Wannafly交流赛1 D-迷宫2
链接:https://www.nowcoder.com/acm/contest/69/D来源:牛客网题目描述这是一个关于二维格子状迷宫的题目。迷宫的大小为N*M,左上角格子座标为(1,1)、右上角格子座标为(1,M)、左下角格子座标为(N,1)、右下角格子座标为(N,M)。每一格都用-1到109之间的整数表示,意义分别为:-1为墙壁,0为走道,而1到109之间的正整数代表特殊的走道。 蜥蜴最初位于...原创 2018-03-04 10:27:58 · 314 阅读 · 0 评论 -
POJ 3278 Catch That Cow
Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions:106274 Accepted: 33215DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediate...原创 2018-03-09 19:37:34 · 91 阅读 · 0 评论 -
POJ 1321 棋盘问题(简单dfs)
棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions:56845 Accepted: 27372Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入...原创 2018-02-26 19:07:01 · 174 阅读 · 0 评论 -
HDU FatMouse and Cheese
#include#include#includeint n, k, map[102][102], d[4][2] = { {1,0},{-1,0},{0,1},{0,-1} },sum[102][102];using namespace std;int main(){ int dfs(int,int); while (cin >> n >> k&&(n+原创 2017-12-05 16:20:01 · 163 阅读 · 0 评论 -
记忆化搜索
时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述给定两个长度为n的整数列A和B,每次你可以从A数列的左端或右端取走一个数。假设第i次取走的数为ax,则第i次取走的数的价值vi=bi⋅ax,现在希望你求出∑vi的最大值。输入描述:第一行一个数T,表示有T组原创 2018-01-02 18:55:26 · 712 阅读 · 0 评论 -
HDU DFS
#includeusing namespace std;int main(){int a[11]; a[1] = 1; a[0] = 1;for (int i = 2; i a[i] = a[i - 1] * i;for (int i = 1; i {int y = i, s = 0;while (y > 0){s = s + a[y % 10];原创 2017-12-01 14:15:51 · 162 阅读 · 0 评论 -
字典序
#include#include#includeint a[6],n;bool b[6];using namespace std;int main(){ voidpp(int); while(cin>>n) { memset(b,false,sizeof(b)); memset(a,0原创 2017-11-19 14:36:45 · 155 阅读 · 0 评论 -
HDU 1426 Sudoku Killer
Sudoku KillerTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 114 Accepted Submission(s) : 43Font: Times New Roman | Verdana | Georgi原创 2017-12-21 22:18:00 · 119 阅读 · 0 评论 -
HDU 1495 非常可乐
非常可乐 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18079 Accepted Submission(s): 7334 Problem Description大家一定觉的运动以后喝可乐是...原创 2017-12-21 15:52:27 · 946 阅读 · 0 评论 -
HDU Knight Moves
Knight Moves Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 56 Accepted Submission(s) : 41Font: Times New Roman | Verdana |原创 2017-12-21 13:49:51 · 174 阅读 · 0 评论 -
HDU Zipper(搜索过的状态标记一下)
ZipperTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 118 Accepted Submission(s) : 53Font: Times New Roman | Verdana | GeorgiaFo原创 2017-12-20 23:02:13 · 193 阅读 · 0 评论 -
HDU 推箱子
推箱子Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 120 Accepted Submission(s) : 46Font: Times New Roman | Verdana | GeorgiaFont原创 2017-12-20 21:46:12 · 764 阅读 · 0 评论 -
HDU Find a way
Find a wayTime Limit : 3000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 137 Accepted Submission(s) : 41Font: Times New Roman | Verdana | Georgia原创 2017-12-20 17:03:27 · 166 阅读 · 0 评论 -
HDU 诡异的楼梯
诡异的楼梯Time Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 182 Accepted Submission(s) : 53Font: Times New Roman | Verdana | GeorgiaFo原创 2017-12-19 22:54:26 · 148 阅读 · 0 评论 -
HDU 1253
#include#include#includeint n,sum,s;bool b[11][11];using namespace std;int main(){ void dfs(int,int,int); while (cin >> n) { sum = 0; s = 0; memset(b, fa原创 2017-12-01 20:08:50 · 183 阅读 · 0 评论 -
HDU 1429
#include#include#include#include#includeint a, b, c, r;bool e, f[51][51][51];using namespace std;queue P, Q, T;int main(){ void dfs(int, int, int, int); int n; cin >> n;原创 2017-12-01 20:44:39 · 179 阅读 · 0 评论 -
dfs 数据保存再利用
#include#includelong long a, b, k1, k2, mod;using namespace std;map P,Q;int main(){long long dfs(long long);cin >> a >> b >> k1 >> k2 >> mod;int R; cin >> R;while (R--){long lo原创 2017-12-02 15:55:16 · 310 阅读 · 0 评论 -
HDU Sum It Up
Sum It UpTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 72 Accepted Submission(s) : 45Font: Times New Roman | Verdana | Georgia原创 2017-12-19 17:02:57 · 155 阅读 · 0 评论 -
HDU 逃离迷宫
逃离迷宫Time Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 230 Accepted Submission(s) : 68Font: Times New Roman | Verdana | GeorgiaFont原创 2017-12-19 16:25:54 · 283 阅读 · 0 评论 -
HDU Square
SquareTime Limit : 10000/5000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 200 Accepted Submission(s) : 73Font: Times New Roman | Verdana | GeorgiaF原创 2017-12-19 13:56:56 · 220 阅读 · 0 评论 -
HDU A strange lift
A strange liftTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 148 Accepted Submission(s) : 67Font: Times New Roman | Verdana | Georg原创 2017-12-19 13:01:09 · 128 阅读 · 0 评论