![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
古古天
如花美眷也敌不过似水流年 心若磐石也敌不过过眼云烟
展开
-
Fence Repair
Problem Description有1Input输入包含多组测试数据,每组测试数据第一行是一个正整数n,接下来n行,每行一个数字,代表木棒长度。Output对于每组测试数据,输出一行正整数,表示把棒还原的最小费用。Sample Input3858Sample Output34Authork原创 2013-04-11 22:28:14 · 884 阅读 · 0 评论 -
Triangles
1010: TrianglesTime Limit: 2 Sec Memory Limit: 128 MBSubmit: 18 Solved: 8DescriptionYou are given a figure consisting of n points in a 2D-plane and m segments connecting some of原创 2013-07-11 10:04:00 · 1158 阅读 · 0 评论 -
Triangle
1006: TriangleTime Limit: 1 Sec Memory Limit: 32 MBSubmit: 29 Solved: 8DescriptionIt is a simple task, for N points on the 2D plane, you are supposed to find whether there are three po原创 2013-07-13 11:34:08 · 1146 阅读 · 0 评论 -
Delete it
Problem A: Delete itTime Limit: 2 Sec Memory Limit: 64 MBSubmit: 99 Solved: 25Description克林在打一行字母时总是会打多一个字符,比如想打”july”时会打成”juuly”,这样他需要删掉其中一个’u’。克林想知道他可以删掉哪个位置的字符就可以变成他真正想打的一行字母。原创 2013-07-16 12:07:16 · 1659 阅读 · 0 评论 -
时间复杂度
在ACM里面,计算复杂度是一项非常重要的事情,常见的复杂度格式有三种:原创 2013-07-16 19:27:20 · 1612 阅读 · 3 评论 -
标准模板库(STL)学习探究之vector容器
标准模板库(STL)学习探究之vector容器 C++ Vectors vector是C++标准模板库中的部分内容,它是一个多功能的,能够操作多种数据结构和算法的模板类和函数库。vector之所以被认为是一个容器,是因为它能够像容器一样存放各种类型的对象,简单地说,vector是一个能够存放任意类型的动态数组,能够增加和压缩数据。为了可以使用vector,必须在你的头文件中包含下面的代转载 2013-07-18 16:37:34 · 997 阅读 · 0 评论 -
HDOJ2546 饭卡
饭卡Time Limit : 5000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 37 Accepted Submission(s) : 14Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断原创 2013-07-21 00:04:42 · 1921 阅读 · 0 评论 -
多连块拼图
给一个大多连块和小多连块,你的任务是判断大多连块是否可以由两个这样的小多连块拼成。小多连块只能平移,不能旋转或者翻转。两个小多连块不得重叠。左下图是一个合法的拼法,但右边两幅图都非法。中间那幅图的问题在于其中一个小多连块旋转了,而右图更离谱:拼在一起的那两个多连块根本就不是那个给定的小多连块(给定的小多连块画在右下方)。Input原创 2013-08-19 21:58:49 · 6115 阅读 · 1 评论 -
DOBRI
DescriptionYou are given a sequence A consisting of N integers (not to be confused with the sequence from the previous task). We will call theith sequence element good if it equals the sum of原创 2013-08-20 20:36:10 · 1095 阅读 · 0 评论 -
The Stable Marriage Problem(稳定婚姻问题)
Description The stable marriage problem consists of matching members of two different sets according to the member’s preferences for the other set’s members. The input for our problem consis原创 2013-08-29 22:49:01 · 1900 阅读 · 0 评论 -
湘潭邀请赛A
哥德巴赫猜想:任一大于2的偶数,都可表示成两个素数之和。是世界上最著名的未解问题之一,但是下面的反哥德巴赫猜想:任一大于11的奇数,都可表示成两个合数之和。确很容易证明。定义反哥德巴赫分拆数g(n)表示将大于11的奇数n分解为两个合数之和的方案数。再定义sg(n)=sum({g(i) | i ≤ n}),即所有不大于n的奇数的反哥德巴赫分拆数之和。你的任务就是快速的计算给定n所原创 2013-09-01 21:25:38 · 1156 阅读 · 0 评论 -
C++组合问题
求一个组合,如C(16,3),我们可以通过公式求出这有多少个数,但怎么把这些数表示出来呢?代码:#include#include#define MAXN 100using namespace std;int a[MAXN];int count=0;void assem(int m,int k){ int i,j; for (i=m;i>=k;i--)原创 2013-07-01 16:23:50 · 1291 阅读 · 0 评论 -
遍历矩阵的n^m种情况的解决办法
例如一个n*n的矩阵,矩阵中所给数据为正,且全部小于某一整数m,现在想要遍历矩阵第一列Matrix[0][i](0那么Matrix[0][0]的取值范围为0~m;Matrix[0][1]的取值范围为0~m;...Matrix[0][i](0可知总共有n^m种情况,但如何枚举这些情况呢?最简单的想法:用n个for循环实现,但这样有两个坏处,第一,由于不知道n的大小,所以实原创 2013-07-08 18:41:58 · 2255 阅读 · 0 评论 -
ZZY的爱好
F: ZZY的爱好 描述 ZZY爱足球~~爱音乐~~爱日剧~~爱电影~~爱A题~~爱萌妹~~总之ZZY喜欢做很多事情~~而且ZZY希望在这些爱好中能收获一些东西~~但是并不是所有爱好对所有目标都是起积极作用的..ZZY十分的困惑..于是ZZY列了下自己想获得的收获并且给每个目标设立了最小要达到的权值...并且给自己的爱好对每个收获目标进行了评值..这个值若是负则代表不利于获得某个收原创 2013-07-06 22:15:50 · 1215 阅读 · 0 评论 -
贪心背包问题
Problem Description有一个背包,背包容量是M=150。有7个物品,物品可以分割成任意大小。要求尽可能让装入背包中的物品总价值最大,但不能超过总容量。物品 A B C D E F G重量 35 30 60 50 40 10 25价值 10 40 30 50 35 40 30分析:目标函数: ∑pi最大约束原创 2013-04-11 23:28:10 · 1188 阅读 · 0 评论 -
DNA sequence
杭电1019Problem DescriptionThe twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. The nucleotide bases from which DNA is built are A(adenine), C(cyt原创 2013-04-16 00:30:53 · 1472 阅读 · 0 评论 -
HDOJ1711 Number Sequence
DescriptionGiven two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K原创 2013-04-24 21:27:31 · 783 阅读 · 0 评论 -
HDU 1686
DescriptionThe French author Georges Perec (1936�1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pair nor原创 2013-04-20 21:19:06 · 970 阅读 · 0 评论 -
简单KMP算法
题目描述:Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见原创 2013-04-20 18:48:36 · 947 阅读 · 0 评论 -
poj1042
Gone FishingTime Limit: 2000MS Memory Limit: 32768KTotal Submissions: 25876 Accepted: 7615DescriptionJohn is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are原创 2013-05-07 01:09:55 · 1958 阅读 · 1 评论 -
湘潭邀请赛总结
参加湘潭邀请赛,也是第一次参加校赛以外的ACM比赛,我们对比赛还是很期待的,虽然成绩不是很理想,但对于我们这些刚走出去的队员来说,我相信未来一定是属于我们的天下。讲一下我们做题过程。开始时,我们拿到题目,首先就是看的A题,也许是做题心切吧,粗略的看了一下题目,以为看懂了,就码代码了,后来发现读错题意了…结果浪费了不久时间,虽然后面在这到题目上,用了搜索的算法,测试数据都对了,也找了好多数据测了原创 2013-05-12 16:29:01 · 1466 阅读 · 4 评论 -
Intersecting Lines
源自POJ1269DescriptionWe all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection becau原创 2013-05-15 00:02:10 · 1124 阅读 · 0 评论 -
Even Odds
A. Even OddsBeing a nonconformist, Volodya is displeased with the current state of things, particularly with the order of natural numbers (natural number is positive integer number). He is determine原创 2013-07-06 17:47:59 · 1619 阅读 · 0 评论 -
Strings of Power
B. Strings of PowerVolodya likes listening to heavy metal and (occasionally) reading. No wonder Volodya is especially interested in texts concerning his favourite music style.Volodya calls a strin原创 2013-07-06 17:52:02 · 1220 阅读 · 0 评论 -
ZZY的宠物(矩阵运算+快速幂)
E :ZZY的宠物描述ZZY领养了一对刚刚出生的不知名小宠物..巨萌巨可爱!!...小宠物的生命为5个单位时间并且不会在中间出意外翘辫子(如: 从0出生能活到5但活不到6)..小宠物经过2个单位时间成熟..刚刚成熟的一对小宠物能立即生育6只新的小宠物(如: 从0出生的一对在2时成熟并进行第一次生育)...小宠物是很忠诚的..不会在中途换伴侣..每对小宠物生育一次这一对的生育能力就会降低2个原创 2013-07-06 21:28:59 · 1321 阅读 · 0 评论 -
HDOJ1864 最大报销额
最大报销额Time Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 14 Accepted Submission(s) : 2Problem Description现有一笔经费可以报销一定额度的发票。允许报销的发票类型原创 2013-07-21 01:25:06 · 1488 阅读 · 0 评论