自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Coldfresh的博客

keeeeeep!~

  • 博客(9)
  • 收藏
  • 关注

原创 Anniversary party HDU - 1520 (树形DP)

There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relation forms a tr...

2017-05-19 15:41:32 386

原创 Color POJ - 2154 (Polya定理)(欧拉函数优化)

Beads of N colors are connected together into a circular necklace of N beads (N<=1000000000). Your job is to calculate how many different kinds of the necklace can be produced. You should know that the

2017-05-11 14:46:40 434

原创 扩展欧几里得算法

返回的第一个是a和b的gcd,第二个是x,第三个是y javastatic int[] extendGCD(int a,int b) { int[]c=new int[3]; if(b==0) { c[0]=a; c[1]=1; c[2]=0; r

2017-05-11 13:01:49 701

原创 欧拉函数及其相关

求指定数值的欧拉算法: static int euler(int n) { int res=n,a=n; for(int i=2;i*i<=a;i++) { if(a%i==0) { res=res/i*(i-1); while

2017-05-10 18:40:16 292

原创 Let it Bead (POJ - 2409) (polya计数原理)

题意: “Let it Bead” company is located upstairs at 700 Cannery Row in Monterey, CA. As you can deduce from the company name, their business is beads. Their PR department found out that customers are int

2017-05-10 16:26:54 382

原创 k倍区间(鸽巢原理?)

给定一个长度为N的数列,A1, A2, … AN,如果其中一段连续的子序列Ai, Ai+1, … Aj(i <= j)之和是K的倍数,我们就称这个区间[i, j]是K倍区间。 你能求出数列中总共有多少个K倍区间吗? 输入 第一行包含两个整数N和K。(1 <= N, K <= 100000) 以下N行每行包含一个整数Ai。(1 <= Ai <= 100000) 输出 输出一个整数,代表K倍

2017-05-08 16:32:21 1009

原创 Find a multiple (POJ - 2356 )(鸽巢原理)

The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000. This numbers are not necessarily different (so it may happen that two or mor

2017-05-08 13:06:25 518

原创 Keep On Movin(HDU-5744)(优化过程)

Professor Zhang has kinds of characters and the quantity of the ii-th character is aiai. Professor Zhang wants to use all the characters build several palindromic strings. He also wants to maximize the

2017-05-07 13:03:55 313

原创 Largest Rectangle in a Histogram (POJ - 2559 )(栈)

A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows t

2017-05-02 14:29:19 388

空空如也

空空如也

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

TA关注的人

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