自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(44)
  • 收藏
  • 关注

原创 提交提示

评测结果缩写含义WaitingWT用户程序正在排队等待测试AcceptedAC用户程序输出正确的结果Presentation ErrorPE用户程序输出有中有多余的空行,或者某行内有多余的空格。Time Limit ExceededTLE用户程序运

2015-04-18 15:46:27 483

原创 最短路径spfa

#include #include #include #include using namespace std;const int inf = 1<<30;const int L = 200000;struct Edges{ int x,y,w,next;} e[L<<2];int head[L];int dis[L];int vis[L];int cnt[

2015-04-09 12:49:01 355

原创 任意进制转换《二》

#include #include #include#includeusing namespace std;long toTen(char a[],int bit){ long i,b=1,sum=0; int length=strlen(a); for (i=length-1;i>=0;i--) { if (a[i]>='A')

2015-04-09 12:47:41 348

转载 itoa()、atoi()、任意进制转换

头文件:itoa --功能:将任意类型的数字转换为字符串。在中与之有相反功能的函数是atoi。atoi----功 能: 将字符串转换成整型数;atoi()会扫描参数nptr字符串,跳过前面的空格字符,直到遇上数字或正负号才开始做转换,而再遇到非数字或字符串时('\0')才结束转化,并将结果返回(返回转换后的整型数)。用 法: int atoi(const char *nptr)

2015-04-07 21:34:33 523

原创 spfa最短路径

C++代码#include #include #include #include using namespace std;const int MAXN=100;const int INF=0x7FFFFFFF;struct edge{    int to,weight;};vector adjmap[MAXN];//邻接表bool in_queue[MAXN];/

2015-04-07 21:27:11 370

转载 不同的GCD算法

分类: C语言程序2014-10-08 15:10 28人阅读 评论(0) 收藏 举报gcdC语言程序位运算早在公元前300年左右,欧几里得就在他的著作《几何原本》中给出了高效的解法——辗转相除法。辗转相除法使用到的原理很聪明也很简单,假设用f(x, y)表示x,y的最大公约数,取k = x/y,b = x%y,则x = ky + b,如果一个数能够同时整除

2014-11-17 21:17:09 710

原创 Hdu-1116 Play on Words

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1116题目大意:给你一些英文单词,判断所有单词能不能连成一串,类似成语接龙的意思。但是如果有多个重复的单词时,也必须满足这样的条件才能算YES。否则都是不可能的情况。解题思路:欧拉路的基本题。只要知道就可以做出来了。关于欧拉回路和欧拉路径定义:

2014-11-13 21:33:45 390

转载 欧拉环、欧拉路径的判定和求法

分类: 系统运维欧拉环:图中经过每条边一次且仅一次的环;欧拉路径:图中经过每条边一次且仅一次的路径;欧拉图:有至少一个欧拉环的图;半欧拉图:没有欧拉环,但有至少一条欧拉路径的图。【无向图】一个无向图是欧拉图当且仅当该图是连通的(注意,不考虑图中度为0的点,因为它们的存在对于图中是否存在欧拉环、欧拉路径没有影响)且所有点的度数都是偶数;一个无向图是半欧拉图当且仅当该图

2014-11-10 19:41:37 1710

原创 HDOJ HDU 1850 Being a Good Boy in Spring Festival

Description一年在外 父母时刻牵挂春节回家 你能做几天好孩子吗寒假里尝试做做下面的事情吧陪妈妈逛一次菜场悄悄给爸爸买个小礼物主动地 强烈地 要求洗一次碗某一天早起 给爸妈用心地做回早餐如果愿意 你还可以和爸妈说咱们玩个小游戏吧 ACM课上学的呢~下面是一个二人小游戏:桌子上有M堆扑克牌;每堆牌的数量分别为Ni(i=1…M);两人轮流

2014-11-01 11:49:31 396

原创 poj1035 Spell checker

DescriptionYou, as a member of a development team for a new spell checking program, are to write a module that will check the correctness of given words using a known dictionary of all correct words

2014-09-27 21:03:39 300

原创 ZOJ Problem Set - 2014 Piggy-Bank【完全背包】

DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea beh

2014-09-27 20:57:56 412

原创 POJ3628:Bookshelf 2【01背包】

DescriptionFarmer John recently bought another bookshelf for the cow library, but the shelf is getting filled up quite quickly, and now the only available space is at the top.FJ has N cows (

2014-09-27 20:41:52 559

原创 HDU 1022 Train Problem I

Problem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is t

2014-09-16 21:05:42 423

原创 POJ 1410 Intersection

DescriptionYou are to write a program that has to decide whether a given line segment intersects a given rectangle.An example:line: start point: (4,9)end point: (11,2)rectangle: left-top

2014-09-15 21:28:59 391

原创 (广度搜索)A - Prime Path(11.1.1)

A - Prime Path(11.1.1)Time Limit:1000MS    Memory Limit:65536KB    64bit IO Format:%I64d & %I64uSubmitStatusDescriptionThe ministers of the cabinet were quite upset by the message from t

2014-08-11 15:49:22 421

转载 STL学习笔记--排序算法

排序算法    C++ STL 的排序算法(Sorting algorithms)是一组将无序序列排列成有序序列的模板函数或与排序相关的模板函数,提供了排序、折半搜索、归并、集合操作、堆操作、最值求解、字典比较和排列组合等功能。    排序算法一般要求容器提供随机访问迭代器,一般适用于序列容器,如向量容器、队列容器和字符串容器等,但不适用于内部数据结构较为复杂的关联容器,如集合容器、映照容

2014-07-27 11:46:49 590

原创 A - Calendar

A - CalendarTime Limit:1000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA calendar is a system for measuring time, from hours and minutes,

2014-07-27 11:13:06 441

原创 - Fractal(3.4.1)

C - Fractal(3.4.1)Time Limit:1000MS    Memory Limit:30000KB    64bit IO Format:%I64d & %I64uSubmitStatusDescriptionA fractal is an object or quantity that displays self-similarity, in

2014-07-24 09:34:41 430

转载 J - MANAGER(2.4.5)

J - MANAGER(2.4.5)Crawling in process...Crawling failedTime Limit:1000MS    Memory Limit:10000KB     64bit IO Format:%I64d & %I64uSubmitStatus DescriptionOne of the program

2014-07-22 21:53:50 417

原创 I - The 3n + 1 problem(2.4.2)

I - The 3n + 1 problem(2.4.2)Crawling in process...Crawling failedTime Limit:1000MS    Memory Limit:10000KB     64bit IO Format:%I64d & %I64uSubmitStatus DescriptionProblem

2014-07-22 21:49:51 385

原创 H - Gold Coins(2.4.1)

H - Gold Coins(2.4.1)Crawling in process...Crawling failedTime Limit:1000MS    Memory Limit:30000KB     64bit IO Format:%I64d & %I64uSubmitStatus DescriptionThe king pays h

2014-07-22 21:27:33 405

转载 Ugly Numbers

Ugly Numbers(1.5.8)Time Limit:1000MS    Memory Limit:10000KB    64bit IO Format:%I64d & %I64uSubmitStatusDescriptionUgly numbers are numbers whose only prime factors are 2, 3 or 5. T

2014-07-20 17:18:03 440

转载 Humble Numbers

Humble NumbersTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15013    Accepted Submission(s): 6525Problem DescriptionA number w

2014-07-20 17:15:48 394

原创 J - Vertical Histogram(1.5.7)

J - Vertical Histogram(1.5.7)Time Limit:1000MS    Memory Limit:65536KB    64bit IO Format:%I64d & %I64uSubmitStatusDescriptionWrite a program to read four lines of upper case (i.e., al

2014-07-20 11:13:22 480

原创 不容易系列之一

不容易系列之一 Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 80   Accepted Submission(s) : 29Font: Times New Roman | Verdana | GeorgiaFont Si

2014-05-01 13:30:46 400

原创 超级楼梯

超级楼梯 Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 72   Accepted Submission(s) : 30Font: Times New Roman | Verdana | GeorgiaFont Size:

2014-05-01 13:28:26 374

原创 母牛的故事

母牛的故事 Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 48   Accepted Submission(s) : 38Font: Times New Roman | Verdana | GeorgiaFont Size

2014-05-01 13:27:19 433

原创 蟠桃记

蟠桃记 Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 68   Accepted Submission(s) : 48Font: Times New Roman | Verdana | GeorgiaFont Size:

2014-05-01 13:23:31 413

原创 Children’s Queue

Children’s Queue Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 80   Accepted Submission(s) : 19Font: Times New Roman | Verdana | Georgia

2014-05-01 13:22:52 470

转载 http://202.194.116.8/webapps/portal/frameset.jsp?tab_id=_2_1&url=%2fwebapps%2fblackboard%2fexecute%2

http://202.194.116.8/webapps/portal/frameset.jsp?tab_id=_2_1&url=%2fwebapps%2fblackboard%2fexecute%2flauncher%3ftype%3dCourse%26id%3d_2328_1%26url%3d

2014-04-15 19:00:41 8069

转载 df

hdu 1052 Tian Ji -- The Horse Racing (2011-08-26 08:32:51)转载▼标签: 杂谈分类: acm杂谈Tian Ji -- The Horse RacingTime Limit : 2000/1000ms (Java/Other)   Memory Li

2014-04-05 11:55:17 422

转载 钥匙计数之一

钥匙计数之一 Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 1   Accepted Submission(s) : 1Font: Times New Roman | Verdana | Georgia Font Size:

2014-04-05 10:03:03 536

翻译 Chronic sleep loss cannot be cured that easily

Chronic sleep loss cannot be cured that easilySleeping in on Saturday after a few weeks of too little shuteye may feel refreshing, but it can give a false sense of security.New research show

2014-03-29 17:39:37 665

转载 杭电ACM 1297 Children’s Queue

这道题是排序问题,可以用递归方法解决。计算F(n):一:当最后一个是男孩M时候,前面n-1个随便排出来,只要符合规则就可以,即是F(n-1);二:当最后一个是女孩F时候,第n-1个肯定是女孩F,这时候又有两种情况:        1)前面n-2个可以按n-2个的时候的规则来,完全可以,即是F(n-2);        2)但是即使前面n-2个人不是合法的队列,加上两个女生也有可

2014-03-22 11:14:19 488

原创 Delta-wave

Delta-wave Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 35   Accepted Submission(s) : 9Font: Times New Roman | Verdana | GeorgiaFont

2014-03-21 20:11:40 442

原创 

Heritage from father Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 131070/65535K (Java/Other)Total Submission(s) : 73   Accepted Submission(s) : 26Font: Times New Roman | Verdana | Geor

2014-03-21 16:56:15 626

翻译 算法思想:

算法思想:(1) 产生两个随机数(2) 产生一个运算符(3) 用户输入答案(4) 验证答案正确与否(5) 转(1) 重复执行 主函数中用到了srand(time(NULL))上百度查了一下和随机产生有关。如果在程序运行时没有自主设置种子的话,用函数rand产生的随机数序列会是一样的。而用srand设置随机数种子后,可能产生不同的随机序列(概率很大)。[c

2014-02-24 23:20:31 535

转载 C++ 运算符重载

C++ 运算符重载什么是运算符的重载?         运算符与类结合,产生新的含义。 为什么要引入运算符重载?         作用:为了实现类的多态性(多态是指一个函数名有多种含义)怎么实现运算符的重载?方式:类的成员函数或友元函数(类外的普通函数)规则:不能重载的运算符有 .  和 .*和 ?: 和 ::  和 sizeof友元函数和成员函数的

2014-02-24 23:13:59 440

原创 A+B problem II

A + B Problem IITime Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 108   Accepted Submission(s) : 21Font: Times New Roman | Verdana | Geo

2014-02-24 23:11:41 543

原创 Integer Inquiry

.Integer InquiryProblem DescriptionOne of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various

2014-02-20 17:21:37 740

空空如也

空空如也

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

TA关注的人

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