码迷,mamicode.com
首页 >  
搜索关键字:algorithm    ( 11758个结果)
UVALive 6663 Count the Regions (离散化,染色,dfs)
https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4675 题意: 二维平面内给出若干矩形,平面被矩形的边分为若干个区域,求一共有多少区域。 分析: 由于矩形只有50个,离散化后的平面大约是100*100的。不妨对于每个矩形覆盖...
分类:其他好文   时间:2014-09-26 02:36:08    阅读次数:198
Service Lane
ServiceLane#include<cmath> #include<cstdio> #include<vector> #include<iostream> #include<algorithm> usingnamespacestd; intmain(){ intN,T,tem; cin>>N>>T; inta[N-1]; for(inti=0;i<N;i++) { cin>>tem; if(tem&..
分类:其他好文   时间:2014-09-26 01:30:18    阅读次数:329
uva 11995 - I Can Guess the Data Structure!
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=&problem=3146&mosmsg=Submission+received+with+ID+14262472 I Can Guess the Data Structure! ...
分类:其他好文   时间:2014-09-26 01:23:18    阅读次数:685
The Love-Letter Mystery
TheLove-LetterMystery#include<cmath> #include<cstdio> #include<vector> #include<iostream> #include<algorithm> #include<string> usingnamespacestd; intmain(){ intT; cin>>T; stringstr; getline(cin,str); while(T--) {..
分类:其他好文   时间:2014-09-26 00:39:28    阅读次数:253
poj 3268 Silver Cow Party(dijkstra最短路)
题目链接:http://poj.org/problem?id=3268 题目大意:给你N个农场,在X农场要举办一个party,其它农场需要到X农场去,然后还要回来,问N个农场中距离最远的那个至少为多少?,给出的边为单向边。。。 思路:用dijkstra最初X农场到其它几个农场的最短距离,然后在把边反向,继续求出X到其它几个农场的最短距离,算出最大的那一个。。。 code: #inc...
分类:其他好文   时间:2014-09-26 00:17:08    阅读次数:241
hdu 4268 Alice and Bob(multiset)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4268 题目大意:就是问你Alice的牌能覆盖Bob牌最多数量。牌不能翻转 思路:首先我们不分种类,把牌按高度排序,然后我们在依次判断牌的种类,如果是Bob的牌,我们就他牌的宽度放入multiset中,如果是Alice的牌就在multiset中找到宽度最大的那一张并删掉。 #include...
分类:其他好文   时间:2014-09-26 00:16:58    阅读次数:215
About The Algorithm Simplification
For mode 1, you have toergod all the data in the files. So thekeypoint to solve this problem is to save the words.I realized that using the Dictionary...
分类:其他好文   时间:2014-09-25 20:39:47    阅读次数:171
单链表操作(数据结构实验一)
实验内容 1 初始化一个带表头结点的单链表。 2 从表头不断插入结点建立一个带表头结点的单链表。设表中元素的类型为整型,元素值从键盘输入。 3 从表尾不断插入结点建立一个带表头结点的单链表。设表中元素的类型为整型,元素值从键盘输入。 4 打印一个带表头结点的单链表。 5 清空一个带表头结点的单链表。 代码:(只是把各个函数写好,并给出了调用数据,其他根据实验要求改就行了) ...
分类:其他好文   时间:2014-09-25 16:41:32    阅读次数:467
hdoj 1074 Doing Homework 【状态压缩dp】
题目:hdoj 1074 Doing Homework  题意:给出一些任务15个,每个任务有截至时间和需要做的天数,超期一天扣一分,求让扣分最小的安排方案。 分析:用状态压缩枚举所有的状态,dp【st】表示在st状态下的最小扣分 转移方程:dp【st | (1 注意这个题目需要打印路径,所以还要一个数组保存状态的转移,递归输出结果即可。 AC 代码: ...
分类:其他好文   时间:2014-09-25 14:06:28    阅读次数:192
STL algorithm算法remove_copy,remove_copy_if(48)
remove_copy原型: std::remove_copy template OutputIterator remove_copy (InputIterator first, InputIterator last, OutputIterator result, const T& val); 该函数是将范围[first,las...
分类:其他好文   时间:2014-09-25 14:05:20    阅读次数:238
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!