11 2016 档案

摘要:One of the first users of BIT’s new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored... 阅读全文
posted @ 2016-11-28 19:00 Tovi 阅读(248) 评论(0) 推荐(0)
摘要:题目链接:HDU1039 /* 题目大意:验证所设密码可否接受,要求满足以下三个条件: 1、必须包含元音 2、三个连续的字母不能同时为元音或者辅音 ... 阅读全文
posted @ 2016-11-26 13:06 Tovi 阅读(144) 评论(0) 推荐(0)
摘要:/* SPFA求单源最短路径长度 时间复杂度O(KE) */#include using namespace std; const int maxn=300001; const int inf =0x7ffffff; struct edge { int from,to,w... 阅读全文
posted @ 2016-11-04 17:40 Tovi 阅读(204) 评论(0) 推荐(0)
摘要:/*树的直径是指树的最长简单路。求法: 两遍BFS :先任选一个起点BFS找到最长路的终点,再从终点进行BFS,则第二次BFS找到的最长路即为树的直径; 原理: 设起点为u,第一次BFS找到的终点v一定是树的直径的一个端点 证明: 1) 如果u... 阅读全文
posted @ 2016-11-04 13:25 Tovi 阅读(495) 评论(0) 推荐(0)