自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 资源 (2)
  • 收藏
  • 关注

原创 [简单dp]toj1179

题意给2n个点,问把他们两两连接有多少种方案,线段不允许交叉

2014-08-30 16:37:12 598

原创 toj1339

/* 要求两步差最多为1, 那么很容易想到序列应该是先增后减的。 关注以下序列: 1 1 1 1 2 1 1 2 2 1 1 2 3 2 1 1 2 3 3 2 1 ... 和分别为1,2,4,6,9,12... 很容易想象,如果两数之差为10(上述9,12间),只需要判断9和12对应的两个序列即可: 1 2 3 2 1......9 1 2 3 3 2 1....12

2014-08-28 13:08:39 540

原创 [toj1136]Humble Number

题意: 质因数除1外最多只有2,3,5,7的数叫Humble Number,输入n,输出第n个Hunble Number.解法:预处理出2,3,5,7的幂(2,4,6,8...3,9,27,81...等),放在四个数组中,然后滚动分配2,3,5,7的指数即可(0~...),把INT范围内的都处理出来扔进vector中排序即可.复杂度O_O(就是没甚么复杂的...)防溢出,最好用long l

2014-08-13 18:38:12 565

原创 [toj1136]Humble Number

只含有质因数2,3,5,7的数叫Humble Number,输入n,输出第n个H

2014-08-13 18:25:45 502

原创 [toj4087]m个不同的箱子放n种不同的球

首先有个三角关系:11 11 3 11 7 5 11 15 17 7 1..递推为f[i][j] = j*f[i-1][j] + f[i-1][j-1]上述是第二类斯特灵数的地推关系第二类斯特灵数描述的问题类似于:m个相同的箱子放n种不同的球,那么分法如上述.如果箱子不同,那么先对箱子排列,所以答案为ans(n,m) = m! * f[n][m]而本题就

2014-08-13 11:08:06 921

原创 [poj3356]字符串dp

/* * dp[i][j]:str1的前i个构成的串变成str2前j个构成的串需要的最少步数 * dp[i][j] = min{ * dp[i-1][j-1]+(str1[i]==str2[j]?0:1) -> 改变 * dp[i-1][j] + 1 -> 删除str1第i个字符 * dp[i][j-1] + 1 -> 添加str2第j个字符到str1的第i个位置 *

2014-08-11 21:41:01 756

原创 [poj3356]字符串dp..2014.8.11

/* * dp[i][j]:str1的前i个构成的串变成str2前j个构成的串需要的最少步数 * dp[i][j] = min{ * dp[i-1][j-1]+(str1[i]==str2[j]?0:1) -> 改变 * dp[i-1][j] + 1 -> 删除str1第i个字符 * dp[i][j-1] + 1 -> 添加str2第j个字符到str1的第i个位置 *

2014-08-11 21:40:02 654

原创 [zoj3314]CAPTCHA炒鸡大模拟

/* * 炒鸡大模拟.整体思想是读入数据后从上往下,从左往右扫描一遍,同时vis数组标记是否访问过,对于没有访问过且为'M'的点,就可以认为 * 它是某个字母的组成部分了,因为组成每个字母的'M'间都是"邻居",所以从发现的这个'M'开始一次BFS/DFS就可以得到和这个'M'相连的 * 所有'M',他们的个数也就是组成这个字母的'M'的个数喽.所以我们需要预处理每个字母对应由几个'M'组成

2014-08-09 21:42:35 679

原创 [zoj3314]CAPTCHA超级大模拟2014.8.9

#include #include #include #include using namespace std;const int MAX = 400;char str[MAX][MAX];int n, m;bool vis[MAX][MAX];int eight[8][2] = {-1,-1, -1,0, -1,1, 0,-1, 0,1, 1,-1, 1,0, 1,1};

2014-08-09 21:07:44 596

原创 慎用mmap[key]!!!

#include #include #include using namespace std;#include int main() { map mmap; cout << "Before test: "; for (map::iterator it = mmap.begin(); it != mmap.end(); ++it) cout first << " "; co

2014-08-08 16:04:02 694

原创 [toj2858]Puzzle Game全排列枚举

题目大意:给一个`4*4`的方格,内有4种字母:A,B,C,D.每种字母有且仅有4个,所以一共是16个字母.每次操作可以交换相邻的两个格子,问至少要操作多少次可以使其中某个2*2的小格子中字母相同.刚开始没有理解清楚题目"每种字母有且仅有4个",所以感觉是一个状态压缩的搜索题.然后...TLE,内存耗了40+MB才发现自己没有去重...然后算了一下状态数量,我的妈呀,1000多万呐...后来想

2014-08-07 21:50:38 666

原创 [新手入门][拓扑排序]

( ⊙ o ⊙ )!O(∩_∩)O哈!

2014-08-06 21:08:11 748

原创 [poj3249]Test For Job

题目大意是JB应聘喷到变态老板,让他做一个变态题.题目要求它zai

2014-08-06 20:49:13 651

原创 [poj1324]状态压缩+BFS

这题昨天开始做的...因为从来没有做过状态压缩.这是第一次接触.

2014-08-06 10:03:24 636

原创 [代码备份]poj1324--未完成

备份备份.写不来状态压缩压缩压缩缩缩

2014-08-05 19:33:08 656

原创 toj3259[Mysterious Numbers]埃式筛法

3259.   Mysterious NumberTime Limit: 1.0 Seconds   Memory Limit:65536KTotal Runs: 1267   Accepted Runs:400Mysterious Number refers to a number which can be divisible by the numbe

2014-08-05 09:10:11 797

原创 [DFS][toj1009Sticks]

不坑爹,更坑爹.详见http://blog.csdn.net/bit_line/article/details/38374445这里修改的部分是处理poj1011

2014-08-04 21:07:39 660

原创 [经典DFS]poj1011Sticks

这题是我遇到的最卡剪枝的题了.很显然的dfs,代码

2014-08-04 20:36:34 745

原创 [代码备份]poj1755

/* * 半成品,但是今天快xie#include #include #include #include #include #include #include using namespace std;const int INF = 0xfffffff;const int MAX = 32;char Map[MAX][MAX];int Move[4][2] = {-1

2014-08-04 19:35:42 695

原创 51416/D辛苦屎了,骗纸呐o o

#include #include #include #include #include #include using namespace std;const int INF = 0xfffffff;const int MAX = 64;int a[MAX][MAX];int n, m, ans;int forwd[4][3][2] = {-3,0, -2,0, -1,0,

2014-08-04 16:03:02 641

原创 位运算技巧

由于位运算是在二进制下进行的,所以他要比普通的加减乘除更快左移一位相当于乘2右移一位相当于整除2和1相与相当于模2 (判奇偶)小技巧:遍历用2进制数s表示的集合的所有子集时,for (i=s; i!=0; i=(i-1&s))即可

2014-08-04 09:36:44 820

原创 toj1205 Compound Words

1205.   Compound WordsTime Limit: 3.0 Seconds   Memory Limit:65536KTotal Runs: 1108   Accepted Runs:344You are to find all the two-word compound words in a dictionary. A two-word

2014-08-02 09:30:08 685

原创 toj1263 Substrings

1263.   SubstringsTime Limit: 1.0 Seconds   Memory Limit:65536KTotal Runs: 3276   Accepted Runs:914You are given a number of case-sensitive strings of alphabetic characters, fi

2014-08-01 19:17:44 672

原创 toj1050二分匹配

#include #include #include #include #include #include using namespace std;const int INF = INT_MAX>>1;const int MAX_V = 512;struct edge {int to, cap, rev;};vector G[MAX_V];int level[MAX_V]

2014-08-01 11:43:54 589

原创 toj1050Courses

1050.   CoursesTime Limit: 5.0 Seconds   Memory Limit:65536KTotal Runs: 1339   Accepted Runs:623Consider a group of N students and P courses. Each student visits zero, one or m

2014-08-01 09:08:16 580

windows10透明任务栏工具

test2

2016-06-22

2016软件工程复习

test

2016-06-22

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除