自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(33)
  • 资源 (5)
  • 收藏
  • 关注

转载 Poj 题型分类

http://old.blog.edu.cn/user3/atomy/archives/2006/1345389.shtml   http://course.zjnu.cn/quyt/show.asp?tab=sjjg&id=65牛人的ACM-POJ的题型分类总结! 这一段时间在做ACM-POJ,好多东西都不懂,搜到如下的总结,准备按照如下分类好好学习,hoho~~

2009-08-26 18:20:00 809

原创 acm hdu 1875 畅通工程再续

http://acm.hdu.edu.cn/showproblem.php?pid=1875 这题与hdu的1102很类似,可以参考下,我都是用同样的方法,用到并查集的知识。理解了并查集做这题就不是很难了,当然同样可以用prim算法……  #include#include#includeusing namespace std;const int MAX=

2009-08-24 08:37:00 1195

原创 acm hdu 3007 Buried memory

http://acm.hdu.edu.cn/showproblem.php?pid=3007 这题对我来说真的是在考验我的英语水平,说真的要不是问了下旁边的还不知道要干嘛?  我也在抱怨为什么自己英文题目都是很难看懂,看来能不能很好的看懂英文题目还是个难关。 可能自己还没有真正的掌握看题的技巧……这题的大意可以理解成有个导弹飞过这些点的范围,要求落在哪个位置可以把所有点

2009-08-20 16:26:00 1372 1

原创 acm hdu 1102 Constructing Roads(kruskal)

http://acm.hdu.edu.cn/showproblem.php?pid=1102 这题折磨了我好久,从上午一直搞到晚上,真是惭愧啊!我也不知道该说些什么了……我知道这题用prim算法是可以的,写起来也简单,只是我自己一直在用kruskal算法,不过对kruskal算法也是有了进一步的理解……应该还是值得的~ #include#includeusing n

2009-08-19 20:40:00 983

原创 素数打印函数

/*a[]: 用于返回素数的数组 n: 产生n以内的素数,按升序放入a[]中 返回值: n以内素数的个数*/#include#include#includeusing namespace std;const int MAX=250000;int prime(int a[],int n){ int i,j,k,x,num,

2009-08-17 18:58:00 524

原创 fzu acm 1015 土地划分

在Dukeswood这块土地上生活着一个富有的农庄主和他的几个孩子。在他临终时,他想把他的土地分给他的孩子。他有许多农场,每个农场都是一块矩形土地。他在农场地图上划上一些直线将矩形分成若干块。当他划直线时,他总是从矩形边界上的某一点划到另一个矩形边界上的点,这条线的结束点将成为下一条线的起始点。他划线时从不会让任三线共点。例如图1是某一种划分结果。 图1 划分的起始点和结束点均以五

2009-08-17 11:38:00 2041 1

原创 扩展欧几里德

矩阵变换在扩展EUCLID算法中的应用 摘要:对于给定的两个正整数a,b, 如何确定两个整数u,v, 使得 au+bv=gcd(a,b), 这里gcd(a,b)表示a,b的最大公约数?本文利用矩阵变换给出两个算法用于求解u,v.  众所周知,对于给定的两个正整数a,b, 求a,b的最大公约数可使用EUCLID算法,其依据是下面的引理。 为了表述方便, 下面均用 a/b表a 除以b的

2009-08-16 20:31:00 774

原创 acm pku 3697 USTC campus network

DescriptionUSTC campus network is a huge network. There is a bi-directional link between every pair of computers in the network. One of the computers is the BBS server, which is so popular that

2009-08-15 17:03:00 1252 1

原创 hdu acm 1913 Computers

Problem DescriptionEverybody is fond of computers, but buying a new one is always a money challenge. Fortunately, there is always a convenient way to deal with. You can replace your computer and get

2009-08-14 11:37:00 691 1

原创 acm hdu 1908 Double Queue

Problem DescriptionThe new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Bucharest, equipped with a modern computing environment provided by IBM Romania, and using modern in

2009-08-13 20:28:00 1006

原创 hdu acm 1907 John(涉及到博弈论)

Problem DescriptionLittle John is playing very funny game with his younger brother. There is one big box filled with M&Ms of different colors. At first John has to eat several M&Ms of the same color

2009-08-13 09:55:00 1871

原创 1490 五子棋

五子棋是起源于中国古代的传统黑白棋种之一。现代五子棋日文称之为"连珠",音译为"Renju",英文称之为"Gobang"或"FIR"(Five in a Row的缩写),亦有"连五子"、"五子连"、"串珠"、"五目"、"五目碰"、"五格"等多种称谓。其规则简单,在15*15的棋盘上黑棋先行,其中一方有五枚棋子连成一线即可获胜(这里不考虑专业比赛中的禁手等规则)。不过在很多情况下,当一方出现“活

2009-08-12 08:53:00 846

转载 一个简单的C++代码,你猜猜结果是什么?

转载自:http://hi.baidu.com/liuflin/blog/item/8bec8d4e6d2caf0cb2de0557.html#includeint main(){ int i=43;printf("%d/n",printf("%d",printf("%d",i)));return 0;} 这段代码的结果是?解析:这是一个关于Printf

2009-08-11 21:44:00 1033 4

转载 搞笑的C程序

转载自http://hi.baidu.com/liuflin/blog/item/bfe8ee2a89f5fa3e5243c10d.htmlresult love(boy, girl){  if ( boy.有房() and boy.有车() )   {    boy.set(nothing);    return girl.嫁给(boy);  }   if ( girl.愿意等() ) 

2009-08-11 21:42:00 609

转载 B字符串在A字符串中出现的次数

转载自http://hi.baidu.com/liuflin/blog/item/786578cc632fbe1700e928d2.html输入两个字符串,分别命名为串A和串B,现要查找出,B在A中出现了多少次,并且输出次数。如ababa和aba,前者是串A,后者是串B,B在A中出现了两次。 #include "stdafx.h"#include "string.h"int m

2009-08-11 21:30:00 5185

转载 两个超大数相加 C++代码

转载自http://hi.baidu.com/liuflin/blog/item/207e7ceffdefae11fcfa3cd0.html#include #include using namespace std;class ds                                                                                  

2009-08-11 21:26:00 6046

原创 最短路径 (Dijstra)与prim的相似

今天好好的,仔细的研究了下Dijstra定理,现在有了比较深的理解。因此模仿写下了这个函数const int MAXSIZE=100;const int INF=1000000;//除对角线外最初都要初始化为无穷int dist[MAXSIZE];void Dijkstra(int cost[][MAXSIZE],int n,int v)//求v到各个顶点的最短路径{ in

2009-08-11 11:34:00 1071

转载 C++/C经典算法百题--(39-42)年龄几何,三色球问题,两个正整数的最大公约数和(GCD)和最小公倍数(LCM)

39.年龄几何张三、李四、王五、刘六的年龄成一等差数列,他们四人的年龄相加是26,相乘是880,求以他们的年龄为前4项的等差数列的前20项。*问题分析与算法设计设数列的首项为a,则前4项之和为"4*n+6*a",前4 项之积为"n*(n+a)*(n+a+a)*(n+a+a+a)"。同时"1。可采用穷举法求出此数列。*程序说明与注释#includeint main(){int n,a

2009-08-11 10:18:00 2511

转载 计算几何相关算法介绍

【声明】本文内容均源于互联网。算法介绍  矢量的概念:  如果一条线段的端点是有次序之分的,我们把这种线段成为有向线段(directed segment)。如果有向线段p1p2的起点p1在坐标原点,我们可以把它称为矢量(vector)p2。  矢量加减法:  设 二维矢量P = ( x1, y1 ),Q = ( x2 , y2 ),则矢量加法定义为: P + Q = ( x1

2009-08-11 10:14:00 1084

转载 计算几何,判两线段相交模板

#include #include struct Point{double x,y;};struct stline{Point a,b;} line1,line2;int dblcmp(double a,double b){if (fabs(a-b)if (a>b) return 1;else return -1;}//***************点积判点是否在线段上******

2009-08-11 10:10:00 668

原创 hdu acm 2104 hide handkerchief

Problem DescriptionThe Children’s Day has passed for some days .Has you remembered something happened at your childhood? I remembered I often played a game called hide handkerchief with my friends.N

2009-08-10 20:41:00 1239

转载 1046 Tempter of the Bone

The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone

2009-08-10 19:28:00 2662

原创 费马小定理

费马小定理Ap-1 mod p = 1p为素数。

2009-08-10 09:35:00 531 1

原创 hdu acm 2100 Lovekey

Problem DescriptionXYZ-26进制数是一个每位都是大写字母的数字。 A、B、C、…、X、Y、Z 分别依次代表一个0 ~ 25 的数字,一个 n 位的26进制数转化成是10进制的规则如下A0A1A2A3…An-1 的每一位代表的数字为a0a1a2a3…an-1 ,则该XYZ-26进制数的10进制值就为 m = a0 * 26^(n-1) + a1 * 26^(n-2) + …

2009-08-09 21:45:00 1041

原创 hdu acm 2106 decimal system

Problem DescriptionAs we know , we always use the decimal system in our common life, even using the computer. If we want to calculate the value that 3 plus 9, we just import 3 and 9.after calculatio

2009-08-09 19:19:00 1565 1

原创 hdu acm 2103 Family planning

Problem DescriptionAs far as we known,there are so many people in this world,expecially in china.But many people like LJ always insist on that more people more power.And he often says he will burn a

2009-08-09 15:20:00 1069

原创 1436 Renting Boats(floyd,Dijkstra应用)

Problem DescriptionYangtse Rive Barge Club has set up n barge hiring stops numbered 1, 2, … , n along the Changjiang River. Passengers can hire barges from any of these stops, and return the barges

2009-08-07 19:41:00 779

原创 1096 prim 最小生成数

In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each other via networks. If two QS want to get connected, they need to buy two network adapters

2009-08-07 09:54:00 687

原创 1701 math

我们知道求两个数最大公约数的一种方法叫辗转相除法。并且当两个数的最大公约数为1时,我们就称这两个数互质。cxw喜欢数学,现在他遇到一个问题正准备向数学大牛daxia请教:“给定一个正整数n,在所有小于n的正整数中,求与n的最大公约数为d的所有的数的和.”,你能帮他解决这个问题吗? Input有多组输入数据,每组数据有两个正整数n,d. 其中1数据保证n能被d整除. Output对于

2009-08-06 09:35:00 549

原创 辗转相除and二分查找

//辗转相除求最大公因子(递归)#include#includeusing namespace std;int gcd(long a,long b){ long r=a%b; if(r==0) return b; else gcd(b,r);}int main(){ long a,b,c; scanf("%d%d",&a,&b

2009-08-04 17:32:00 524

原创 1656 How many different numbers

Recently oaiei has encountered a problem. And he needs your help. There are N numbers in an array and Q queries. For each query, there are two integers S and T. And the proplem is that there are how m

2009-08-03 17:30:00 512

原创 1012 求小于n的数里,与n互为素数的个数

///求小于n的数里,与n互为素数的个数,这边用到欧拉公式。#include#includeusing namespace std;int main(){ long n,i; double sum; while(scanf("%ld",&n)&&n) { sum=n; if(n%2==0)// { sum*=(double)1/2;

2009-08-03 17:07:00 914

原创 1635 floyd 的应用

A group of commandos were assigned a critical task. They are to destroy an enemy head quarter. The enemy head quarter consists of several buildings and the buildings are connected by roads. The comman

2009-08-02 18:33:00 407

多进程编程卡死解决方案

居于对话框多进程编程,解决ui卡死、刷新问题

2015-04-16

银行家算法

这是我用c实现的银行家算法,我把需求文档也附上了,供大家急需之用,哈哈

2011-10-08

操作系统课程设计

这是我用c在内存中模拟二级文件管理系统的一个小程序,仅供大家参考!

2011-10-08

仓库管理系统(c课程设计)

自己实现的仓库管理系统课程设计,大家参考下!

2010-05-13

学分管理系统(c++课程设计)

这是我做的一个简单的学分管理系统课程设计,里面有我的实现代码~ 欢迎大家下载共享!

2010-05-13

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除