自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 【SGU 180】Inversions —— 归并排序或树形数组计算逆序对

分别采用归并排序、树形数组来计算逆序对

2015-04-28 23:36:43 676

原创 【HDU 1754】I Hate It —— 线段树(数组和指针实现)

线段树(Segment Tree)的数组和指针实现

2015-04-28 18:28:52 593

原创 【HDU 1005】Number Sequence —— 找周期

原题链接Number SequenceTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 122213    Accepted Submission(s): 29653Problem Descript

2015-04-27 17:32:08 733

原创 【HDU 1019】Least Common Multiple —— LCM

原题链接解题报告:很简单的水题,就是求LCM而且指明了是在int范围内!唯一值得注意的是:lcm函数中必须先除再乘,否则有溢出的可能!#include using namespace std;int gcd(int a,int b){ if(b==0) return a; return gcd(b,a%b);}int lcm(int

2015-04-23 23:59:05 504

原创 【HDU 1018】Big Number —— n!的位数

原题链接解题报告:由于最大能达到10^7! 故而不能直接用高精度整数算出结果,然后取位数……所以转换思路,从数学角度算出n!的位数,推导如下:因为len(n)=floor( log10(n) )+1设A=n!=1*2*3*...*n所以len(A)-1=floor( log10(A) )=floor( log10(1*2*3*...*n) )=floor( lo

2015-04-23 23:01:38 433

原创 【HDU 1040】As Easy As A+B —— 排序

原题链接解题报告:直接排序即可,没什么可说的!如果想自己写排序算法,倒是一道不错的练习题!#include #include #include #include #include using namespace std;const int MAX=1000000;int a[MAX];int main(){ int T,n;

2015-04-23 22:04:32 396

原创 【HDU 1012】u Calculate e —— 输出格式

原题链接解题报告:输出格式隐含要求是精确到小数点后9位。刚开始用cout#include #include #include #include using namespace std;int main(){ double ans=1.0;int f=1; cout<<"n e"<<endl; cout<<"- ----------

2015-04-23 21:53:57 587

原创 【HDU 1042】N! —— 高精度整数

原题链接解题报告:由于N能达到10000,故而肯定要用高精度整数乘法来解题!考虑到用10来做基数,大大浪费了int的比特数,故而采用10000为基数,但是这时候输出时就要注意输出格式问题:填充0来保持4位。#include #include #include #include using namespace std;int a[100000]={0}

2015-04-23 21:17:30 445

原创 【HDU 5207】Greatest Greatest Common Divisor —— 最大公因子

原题链接Greatest Greatest Common DivisorTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 665    Accepted Submission(s): 298Problem

2015-04-22 10:18:17 541

原创 【HDU 5206】Four Inages Strategy —— 计算几何之空间正方形

原题链接Four Inages StrategyTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 664    Accepted Submission(s): 259Problem Descript

2015-04-21 23:40:53 540

原创 【HDU 4150】Powerful Incantation —— 字符串匹配

原题链接Powerful IncantationTime Limit: 5000/2000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1555    Accepted Submission(s): 688Problem Descrip

2015-04-21 20:30:13 438

原创 【ZOJ 3780】Paint the Grid Again —— 模拟拓扑排序

原题链接Paint the Grid AgainTime Limit: 2 Seconds      Memory Limit: 65536 KBLeo has a grid with N × N cells. He wants to paint each cell with a specific color (either black or white).

2015-04-18 17:38:49 475

原创 【HDU 1016】Prime Ring Problem —— DFS

点击打开链接Prime Ring ProblemTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 31406    Accepted Submission(s): 13903Problem DescriptionA ring

2015-04-17 19:25:04 422

原创 【HDU 1312】Red and Black —— DFS

原题链接Problem DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four

2015-04-17 17:40:19 413

原创 Windows下Python的强力助手——Pypi

在Windows下一定要下载安装pypi,如果你要经常导入一些其他库的话!!!这是血与泪的教训啊,特写此文铭记……下面是安装pypi的步骤:1、download get-pip.py2、打开cmd,cd到你刚下载下来的get-pip.py的地址,运行下列语句(ps:运行前确保设置了python环境变量):python get-pip.py安装过程截图如下:3

2015-04-08 17:19:13 769

原创 【更新】排序算法比较:插入排序,冒泡排序,归并排序,堆排序,快速排序,计数排序,基数排序,桶排序

排序算法比较:插入排序,冒泡排序,归并排序,堆排序,快速排序,计数排序,基数排序,桶排序

2015-04-05 17:10:05 958

空空如也

空空如也

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

TA关注的人

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