- 博客(22)
- 收藏
- 关注
原创 UVA 123 Searching Quickly
题意:给出一系列要忽略的单词,这些单词以外的单词都看作关键字。然后给出一些标题,找出标题中所有的关键字,然后按这些关键字的字典序给标题排序。注意两点:相同关键字出现在不同标题中,出现在输入较前位置的标题排在前面(从样例数据可以看出,而且multimap也正是这么做的);同一个关键字在一个标题中出现多次,关键字位于较前位置的排在前面(从左向右扫描的话就没有问题)。#include#i
2014-04-27 00:22:01 3000
原创 快排存档
好久没敲快排了,今天搞了半天居然不会,先存档再说,rtvoid quicksort(int *A, int low, int high){ int m=A[low]; int r=high,l=low; while(l<r) { while(A[l]<m)l++; while(A[r]>m)r--; if(l<=r){ int t=A[l];
2014-04-24 21:50:53 1502 1
原创 poj1659(Havel-Hakimi定理)
Frogs' NeighborhoodTime Limit: 5000MS Memory Limit: 10000KTotal Submissions: 6676 Accepted: 2904 Special JudgeDescription未名湖附近共有N个大小湖泊L1, L2, ..., Ln(其中包括未名
2014-04-21 22:26:36 1107 2
原创 图论学习
用邻接表存储有向图,并输出各顶点的出入和入度。输入描述:输入文件中包含多个测试数据,每个测试数据描述了一个无权有向图。每个测试数据的第一行为两个正整数n和m,1≤n ≤100,1≤ m ≤500,分别表示该有向图的顶点数目和边数,顶点的序号从1开始计起。接下来有m行,每行为两个正整数,用空格隔开,分别表示一条边的起点和终点。每条边出现一次且仅一次,图中不存在自身环和重边。输入文
2014-04-21 22:17:38 1336
原创 UVA 674完全背包
#include #include#include#define INF 0X7ffffffftypedef long long LL;LL dp[8000];int sum=0;int main(){ //freopen("input.txt","r",stdin); int n; while(~scanf("%d",&n)) { i
2014-04-21 17:12:36 958
原创 UVA 103
Stacking Boxes BackgroundSome concepts in Mathematics and Computer Science are simple in one or two dimensions but become more complex when extended to arbitrary dimensions. Co
2014-04-21 17:04:50 863
原创 UVA 111
和最长公共子序列差不多的dpA - History GradingTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice UVA 111Appoint description: System Crawler (2014-03
2014-04-21 17:00:24 911
原创 hdu 1203(01背包)
NEED A OFFER!Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2014-04-03)DescriptionSpeakless很早就想出
2014-04-20 20:09:35 891
原创 hdu 2602(01背包裸题)
Bone CollectorTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2014-04-03)DescriptionMany years ago
2014-04-20 20:05:14 987
原创 POJ 1862
H - StripiesTime Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2013-05-30)DescriptionOur chemical
2014-04-20 20:00:56 794
原创 hdu 1114(完全背包裸题)
Piggy-BankTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2014-03-08)DescriptionBefore ACM can do
2014-04-20 19:57:20 781
原创 poj 1088
滑雪Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2014-04-20)DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪
2014-04-20 19:52:03 824
原创 hdu 2571
命运Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2013-05-30)Description穿过幽谷意味着离大魔王lemon已经无限接近了!
2014-04-20 19:46:03 758
原创 poj1163(数字三角形)
The TriangleTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2014-04-14)Description73 88
2014-04-20 19:38:13 1072
原创 POJ 1742(特别技巧之多重背包转完全背包)
DescriptionFarmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest number of coins changes hands, i.e.,
2014-04-15 19:46:57 1108
转载 hdu题目分类
1001 (AC) 入门1002 (AC) 简单的大数1003 (AC)DP经典问题,最大连续子段和1004 (AC)简单题1005 找规律(循环点)1006 感觉有点BT的题,我到现在还没过1007 经典问题,最近点对问题,用分治1008 简单题1009 贪心1010 搜索题,剪枝很关键10111012 简单题1013 (AC)简单题(有个小陷
2014-04-15 19:21:53 930
转载 hdu dp专题
homework任务优化numbersmatrix招聘HDU46道DP题[转自网络]Robberies http://acm.hdu.edu.cn/showproblem.php?pid=2955背包;第一次做的时候把概率当做背包(放大100000倍化为整数):在此范围内最多能抢多少钱 最脑残的是把总的概率以为是抢N家银行的概率之和… 把状态转移方程写成了
2014-04-10 17:58:23 1446
原创 Codeforces Round #240 (Div. 2) Mashmokh and Numbers
题意找出一组数列,满足每相邻的两个数的最大公因数和为给定的值。,注意相邻两个数的公约数为一就好做了,注意下边界即可C. Mashmokh and Numberstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutp
2014-04-09 23:12:11 1332
原创 NEUOJ 1391: Big Big Power(费马小定理&快速幂)
费马小定理是数论中的一个重要定理,其内容为: 假如p是质数,且(a,p)=1,那么 a^(p-1) ≡1(mod p)。即:假如a是整数,p是质数,且a,p互质,那么a的(p-1)次方除以p的余数恒等于1。稍微变化一下就是(a^b)%p=a^[b%(p-1)]%p。本题计算a^(b^c)%(1e9+7)先把(b^c)看成整体应用费马小定理有,a^[(b^c)%(1e9+7-1)]=[a
2014-04-06 17:56:29 1927
原创 hdu 1003(最大连续子序列和)
Max SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 132525 Accepted Submission(s): 30717Problem DescriptionGiven a sequenc
2014-04-06 00:43:08 1273
原创 NEUOJ 1302: 最大子序列(双向dp)
第一次写dp,有点小激动哈哈,纪念下1302: 最大子序列时间限制: 1 Sec 内存限制: 128 MB提交: 174 解决: 41[提交][状态][讨论版]题目描述给定一个N个整数组成的序列,整数有正有负,找出两段不重叠的连续子序列,使得它们中整数的和最大。两段子序列都可以为空。输入多组输入,每组第一行为N
2014-04-04 20:04:01 1291
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人