
ACM代码123
文章平均质量分 70
zydirtyfish
这个作者很懒,什么都没留下…
展开
-
UVA 10106 Product(大数乘法)
The Problem The problem is to multiply two integers X, Y. (0 The Input The input will consist of a set of pairs of lines. Each line in pair contains one multiplyer. The Output For原创 2013-07-29 20:03:16 · 566 阅读 · 0 评论 -
hdu 1250 Hat's Fibonacci(大数加法)
Problem DescriptionA Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1. F(1) = 1, F(2) = 1, F(3) = 1,F(4) = 1, F(n>4) = F(n -原创 2013-07-29 16:45:34 · 572 阅读 · 0 评论 -
sort函数对数组排序
注意头文件:#include using namespace std;1.默认的sort函数是按升序排。对应于1)sort(a,a+n); //两个参数分别为待排序数组的首地址和尾地址2.可以自己写一个cmp函数,按特定意图进行排序。对应于2)例如:int cmp( const int &a, const int &b ){ if( a > b )原创 2013-07-30 17:06:07 · 1376 阅读 · 0 评论 -
UVA 729 - The Hamming Distance Problem 解题报告
The descriptionThe Hamming distance between two strings of bits(binary integers) is the number of corresponding bit positions that differ.This can be found by using XOR on corresponding bits or equi原创 2013-07-30 20:31:14 · 735 阅读 · 0 评论 -
今天A了好多畅通工程————hdu-1874再续畅通工程
Problem Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于100原创 2013-08-01 19:40:26 · 518 阅读 · 0 评论 -
二分查找及lower_bound与upper_bound
二分查找(迭代实现)二分查找#include #include#include#includeconst int maxn=1000;int a[maxn],n,t[maxn],p;int bsearch(int *a,int x,int y,int n){ int m; while(x<y) { m=x+(y-x)/2;原创 2013-08-14 14:32:50 · 769 阅读 · 0 评论 -
苗大神教我的拓扑排序,欧耶!!!
DescriptionDandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the rewards.The work原创 2013-10-02 16:38:55 · 1518 阅读 · 0 评论 -
hdu2571 简单dp的两种解决思路
命运Problem Description穿过幽谷意味着离大魔王lemon已经无限接近了!可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑!可怜的yifenfei为了去救MM,义无返顾地跳进了迷宫。让我们一起帮帮执着的他吧!命运大迷宫可以看成是一个两维的原创 2013-10-13 12:23:20 · 742 阅读 · 0 评论 -
hdu1176 免费馅饼(传说这是数塔的变换形式)
免费馅饼Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,原创 2013-10-13 16:20:00 · 603 阅读 · 0 评论