- 博客(90)
- 资源 (2)
- 收藏
- 关注
原创 重生, 燃烧的生命
这个学期过的非常非常不好, 原因种种. 最近好好想想, 其实就是自己顾虑得太过, 现在, 我应该重拾青春, 重新起航. 确实, 人不得不做一些自己并不喜欢做的东西, 但是那又怎样, 快速的完成它们, 然后就有时间做自己想做的事情了, 是不是这样的道理呢? 以前大一大二的时候, 也有很多自己不喜欢的做的事情, 但是每次都是自己快速地完成了, 然后挤出时间做了自己认为有趣的事情, 请问, 那时候, 我
2014-12-09 21:45:25
623
转载 图像处理:基础(模板、卷积运算)
1.使用模板处理图像相关概念: 模板:矩阵方块,其数学含义是一种卷积运算。 卷积运算:可看作是加权求和的过程,使用到的图像区域中的每个像素分别于卷积核(权矩阵)的每个元素对应相 乘,所有乘积之和作为区域中心像素的新值。 卷积核:卷积时使用到的权用一个矩阵表示,该矩阵与使用的图像区域大小相同,其行、列都是奇数,
2014-12-07 10:37:41
1155
原创 Python常用的一些操作(持续更新中......)
任务1: 要求从控制台输入两个整数n,m 方法一: n,m = map(int,raw_input().split()) 方法二: cin = raw_input().split() data = map(int,cin) n = data[0] m = data[1]
2014-08-10 14:58:49
436
转载 最少操作次数(英雄会)
作者博客链接题目详情:给定两个字符串,仅由小写字母组成,它们包含了相同字符。求把第一个字符串变成第二个字符串的最小操作次数,且每次操作只能对第一个字符串中的某个字符移动到此字符串中的开头。例如给定两个字符串“abcd" "bcad" ,输出:2,因为需要操作2次才能把"abcd"变成“bcad" ,方法是:abcd->cabd->bcad。---------------
2014-02-22 01:55:41
1772
转载 数学常数e的含义
1. e是一个重要的常数,但是我一直不知道,它的真正含义是什么。 它不像π。大家都知道,π代表了圆的周长与直径之比3.14159,可是如果我问你,e代表了什么。你能回答吗? 维基百科说: "e是自然对数的底数。" 但是,你去看"自然对数",得到的解释却是: "自然对数是以e为底的对数函数,e是一个无理数,约等于2.718281828。"
2014-02-03 11:10:56
810
原创 动态规划-基础篇——最长上升子序列(nlogn)
我写这片博文就只是提醒自己不要理解而已,其中只是一个结论,其实的证明,思路啥的都没写,以后搞dp专题的时候会全部补上,这里只是一个开头。对于最长上升子序列(LIS)问题中,一直对lower_bound(),和upper_bound()分不清楚。用法是:如果是严格LIS,则用的是lower_bound(),如果是非严格LIS,则用的是upper_bound();
2014-01-24 20:24:00
1485
原创 FZU 2151 OOXX Game
L - OOXX Game题目链接题意和题目思路很简单:如‘O’的数量为奇数为 “Maze”,否则为"Fat brother";/** author:liuwen*/#include #include #include #include using namespace std;int main(){ // freopen("in.txt","r",std
2014-01-24 00:56:02
790
原创 FZU 2150 Fire Game(枚举两个源点的bfs)
K - Fire Game题目链接题目大意:给定一个图,‘.’表示空地,'#'表示草地。选择2块草地为放火点,火势每秒向上下左右蔓延。开始时间为0,问所有草地被燃烧的最少时间。如果不能,则输出-1。思路;枚举两个块草地u,v。然后以这两个点为原点进行bfs。dist[i][j]表示草地i到草地j的最短距离。dist[][]初始化为Inf。那么每次枚举的两块草地u,v后,
2014-01-24 00:54:55
585
原创 FZU 2147 A-B Game
H - A-B Game题目链接题目大意:输入两个长整型的数a,b。有一种将a变化的操作为:a=a-(a%x), 其中 1问最少有多少次操作才能使得a思路:贪心因为每次操作a=a-(a%x),1看如下变形:因为a%x=a-(a/x)*x, 则a-(a%x)=(a/x)*x;要使其最小,x=a/2+1时,(a/x)*x最小。/** author:liuw
2014-01-24 00:53:27
1049
1
原创 fzu 2148 Moon Game
I - Moon Game题目链接题目大意:给定n个点的坐标,判断能组成由多少凸四边形。思路一:枚举三个点a,b,c,这三个点组成三角形ABC(若是直线也被认为是三角形),总剩下的点中取一个d,并判断它是否可以组成凸四边形abcd。具体方法如下:/** author:liuwen*/#include #include #include #include usi
2014-01-24 00:52:20
589
原创 第四届(2013年十月)福建省大学生程序设计竞赛
G - Easy Game题目链接题意:输入一个字符串,判断该字符串长度的奇偶性。相当简单。/** author:liuwen*/#include #include #include #include using namespace std;int main(){ int T; int cas=0; scanf("%d",&T);
2014-01-24 00:49:30
868
原创 几种形式下的二分搜索
操作对象: 给定一个不减序列 int incre[9]={1,2,2,2,2,4,6,6,8}; 给定一个不增序列 int decre[9]={8,6,6,4,2,2,2,2,1};第一种:int binary_search(int *a,int x,int y,intv); 在[x,y)区间中查找满足a[i]=v的i的值,若不存在,则返回-1;其中a
2014-01-20 18:56:47
617
原创 poj1529Shipping Routes(floyd)
其中leg理解为路(双向)即可。翻译链接描述:The Slow Boat to China Shipping company needs a program to help them quickly quote costs to prospective customers. 某船需要给客户预期报价。The cost of a shipment depends on the size of
2013-12-28 17:16:36
746
原创 poj1502MPI Maelstrom(Dijkstra等等最短路的入门题)
MPI MaelstromTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4663 Accepted: 2831DescriptionBIT has recently taken delivery of their new supercomputer, a 3
2013-12-28 16:13:55
608
原创 POJ杂题(水杂)
poj 3673Cow Multiplication 题目链接题目大意:解题思路:二重循环累加及行了代码链接poj 3749破译密码题目链接题目大意:中文题,意思很好理解。解题思路:直接模拟,但是注意一下输入 :cin直接跳过空格和换行'\n',并且以'\n'结束,但是最后'\n'还会存在缓冲区,可以被getchar()或者gets()读取代码链接poj3671
2013-12-27 22:37:30
753
原创 codeforces #221(div2)B. I.O.U.
B. I.O.U.time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputImagine that there is a group of three friends: A, B and С.
2013-12-25 01:09:41
1326
原创 poj 1237(欧拉回路+floyd)
The Postal Worker Rings OnceTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 674 Accepted: 427DescriptionGraph algorithms form a very important part of com
2013-12-24 17:30:02
938
转载 图论——握手定理
三.顶点的度数与握手定理1.顶点的度数 定义14.4设G=为一无向图,v∈V,称v作为边的端点次数之和为v的度数,简称为度,记做 dG(v),在不发生混淆时,简记为d(v).设D=为有向图,v∈V,称v作为边的始点次数之和为v的出度,记做(v),简记作d+(v).称v作为边的终点次数之和为v的入度,记做(v),简记作d-(v),称d+(v)+d-(v)为v的度数,记做d(v
2013-12-24 08:56:55
9227
原创 poj 1130 Alien Security (dfs+bfs<反向最短路>)
Alien SecurityTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 2646 Accepted: 974DescriptionYou are in charge of security at a top-secret government resear
2013-12-23 21:22:47
850
原创 poj2197||zoj2406 Jill's Tour Paths(回溯+优先队列)
Jill's Tour PathsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1361 Accepted: 407DescriptionEvery year, Jill takes a bicycle tour between two villages.
2013-12-23 00:28:15
733
原创 zoj3464 Rugby Football(贪心)
Rugby FootballTime Limit: 2 Seconds Memory Limit: 65536 KB CM is a member of Rugby football club of ZJU. He loves to play the game. Every Friday afternoon there is a club training of sk
2013-12-22 12:52:42
624
原创 zoj 3359 Penalties Kick
DescriptionFootball is an excellent game, but sometimes it is cruel. As you know, two football teams may have a tie after regular time and even addition time, but we have to judge who is the winne
2013-12-22 11:25:56
671
原创 ZOJ 3675 Trim the Nails(bfs+状态压缩搜索)
Trim the NailsTime Limit: 2 Seconds Memory Limit: 65536 KB Robert is clipping his fingernails. But the nail clipper is old and the edge of the nail clipper is potholed.The nail clippe
2013-12-21 15:31:58
588
原创 用位运算来处理集合中的交,并,补(对称差)运算
/* @author : liuwen*/#include #include #include #include //INT_MAX INT_MIN LONG_LONG_MAX LONG_LONG_MIN#include #include #include #include #include #include #include using namespace s
2013-12-21 12:18:11
1384
原创 poj1106 Transmitters (枚举+叉积运用)
TransmittersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4328 Accepted: 2295DescriptionIn a wireless network with multiple transmitters sending on the
2013-12-18 23:18:54
588
原创 poj1484||zoj1195 Blowing Fuses (模拟)
DescriptionMaybe you are familiar with the following situation. You have plugged in a lot of electrical devices, such as toasters, refrigerators, microwave ovens, computers, stereos, etc, and have t
2013-12-17 00:01:47
915
原创 13年12月校赛总结
今天打了一场校赛,也是期末之前最后一场校赛(其实一共也没举行过几场)。在和小伙伴一起努力的情况下,结果是相当的意外(第几就不说了)。不过从比赛中还是暴露了很多的问题。第一:题目没有分析透彻就开始搞题,具体就是在F题的那个进制转化上,本来只要仔细一想就知道long long 就可以过,可是一开始就乱搞,以为java方便。。可以真正用java的时候又不知道调用准确的用哪些有用的方法。最后还是用C+
2013-12-15 23:40:08
508
原创 Codeforece#219(DIV2) C题
C. Counting Kangaroos is Funtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n kangaroos with pockets. Each
2013-12-14 10:02:13
901
原创 poj1860 Currency Exchange(货币交换,最短路问题)
Currency ExchangeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 17436 Accepted: 6112DescriptionSeveral currency exchange points are working in our city.
2013-12-13 00:16:30
775
原创 poj 1797 Heavy Transportation
Heavy TransportationTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 18592 Accepted: 4915DescriptionBackgroundHugo Heavy is happy. After the breakdown of
2013-12-12 09:56:17
475
原创 poj1178 Camelot(floyd+枚举)
CamelotTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 2558 Accepted: 1190DescriptionCenturies ago, King Arthur and the Knights of the Round Table used to
2013-12-11 08:33:18
647
原创 poj1125 POJ 1125 Stockbroker Grapevine(两种方法Dijkstra或者floyd)
Stockbroker GrapevineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 24440 Accepted: 13443DescriptionStockbrokers are known to overreact to rumours. You h
2013-12-10 18:43:23
736
原创 poj1062 昂贵的聘礼(Dijkstra+枚举等级处理)
昂贵的聘礼Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 33464 Accepted: 9533Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探
2013-12-10 13:45:53
576
转载 浅谈程序员的数学修养
//转载至http://blog.youkuaiyun.com/hu1020935219/article/details/17101819可能有很多朋友在网上看过Google公司早几年的招聘广告,它的第一题如下了:{first 10-digit prime found in consecutive digits e}.com,e中出现的连续的第一个10个数字组成的质数。据说当时这个试题在美国很多地铁的
2013-12-09 13:21:20
579
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人