- 博客(11)
- 资源 (3)
- 收藏
- 关注
原创 深搜 从n个数中随机选取m个数 求出所有组合的和 模版
#include #include #include #include using namespace std;mapq;int a[99999];int n,m;int num=0;int dfs(int x,int y,int z) //第X个 已经加了Y个了 总和已经达到Z{ if(y==m) {
2017-07-24 16:32:26 1290
原创 宽搜模版
#includeusing namespace std;struct s //结构体用来表示坐标{ int x; int y;};queue q; //队列用来行走int d[1999][1999]; //记录步数bool v[1999][1999]; //标记是否走过char Map[199]
2017-07-21 15:18:02 1893 2
原创 不依赖数组 论述
当需要输入一组数据或一串字符时,当按照题目需要对每一个数据或字符进行判断,转换等操作并且每个数据或字符需要进行的都是相同类型的操作,这时候可以考虑逐个输入数据或字符,然后编写一段功能代码,对它们进行逐个操作。
2017-07-21 14:37:17 155
原创 不依赖数组(字符串版)
同样是不依赖于数组,逐个输入字符,逐个进行操作Edward, a poor copy typist, is a user of the Dvorak Layout. But now he has only a QWERTY Keyboard with a brokenCaps Lock key, so Edward never presses the brokenCaps
2017-07-21 14:23:05 282
原创 不要什么都依赖数组
有些题目不用数组反而更简单 依次输入数据,每输入一个数据就对其进行操作,判断There is a mysterious organization called Time-Space Administrative Bureau (TSAB) in the deep universe that we humans have not discovered yet. This
2017-07-21 10:44:38 227
原创 并查集模版及其示例
1 先通过查找根节点将该连在一起的连在一起2 连接完之后,统计总共有多少伙 #include #include using namespace std; int tree[50010]; int find(int x) //寻找根节点 { if(x == tree[x])
2017-07-20 21:43:20 190
原创 模拟 字符串变一样
In Berland each high school student is characterized by academic performance — integer value between 1 and5.In high school 0xFF there are two groups of pupils: the groupA and the group B. Each
2017-07-19 16:08:09 146
原创 基础深搜 红白地砖问题
F - Red and BlackThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent
2017-07-16 17:36:10 334
原创 基础宽搜 奶牛最少步数问题
I - Catch That CowFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a pointN (0 ≤ N ≤ 100,000) on a number line and the cow is
2017-07-16 17:04:45 271
原创 模拟 回文时间问题
Karen is getting ready for a new school day!It is currently hh:mm, given in a 24-hour format. As you know, Karen lovespalindromes, and she believes that it is good luck to wake up when the tim
2017-07-16 15:21:27 272
原创 基础宽搜 迷宫最少步数问题
最少步数时间限制:3000 ms | 内存限制:65535 KB难度:4描述 这有一个迷宫,有0~8行和0~8列: 1,1,1,1,1,1,1,1,1 1,0,0,1,0,0,1,0,1 1,0,0,1,1,0,0,0,1 1,0,1,0,1,1,0,1,1 1,0,0,0,0,1,0,0,1 1,1,0,1,0,1,0,0,1 1,1,0,1,
2017-07-16 10:07:27 906
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人