自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

AK_HuangYC的博客

人一我十,人十我百

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

原创 HDU 4602 Partition 组成n的方案中k有几个 (好题!!!!找规律题+快速幂)

Define f(n) as the number of ways to perform n in format of the sum of some positive integers. For instance, when n=4, we have  4=1+1+1+1  4=1+1+2  4=1+2+1  4=2+1+1  4=1+3  4=2+2  4=3+1

2016-01-29 13:09:44 601

原创 HDU 1025 最长上升子序列变形 (dp+二分)

将二维转化为一维... 把第一维进行排序就不用考虑第一维的情况了!!!!!解题报告:就是求最长上升子序列,一开始用的普通办法求的!直接TEL;就在网上找了一个时间复杂度为O(nlogn)的算法,其算法思想为:(网上找的)假设要寻找最长上升子序列的序列是a[n],然后寻找到的递增子序列放入到数组b中。(1)当遍历到数组a的第一个元素的时候,就将这个元素放入到b数组中,以后

2016-01-28 23:35:33 513

原创 HDU 1787 GCD Again (欧拉函数)

Problem DescriptionDo you have spent some time to think and try to solve those unsolved problem after one ACM contest?No? Oh, you must do this when you want to become a "Big Cattle".Now you wi

2016-01-28 21:50:48 435

原创 HDU 3501 Calculation 2 (欧拉函数)

小于等于n,且与n互质的因子sum= euler(n)*n/2Problem DescriptionGiven a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A

2016-01-28 16:48:23 352

原创 HDU The Euler function (欧拉函数打表)

Problem DescriptionThe Euler function phi is an important kind of function in number theory, (n) represents the amount of the numbers which are smaller than n and coprime to n, and this function h

2016-01-28 15:04:40 455

原创 欧拉函数(模板)

//直接求解欧拉函数int euler(int n){ //返回euler(n) int res=n,a=n; for(int i=2;i*i<=a;i++){ if(a%i==0){ res=res/i*(i-1);//先进行除法是为了防止中间数据的溢出 while(a%i==0) a/=i;

2016-01-28 15:03:38 705

原创 HDU 1286 找新朋友 (欧拉函数_打表)

Problem Description新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。Input第一行是测试数据的组数CN(Case number,1Output对

2016-01-28 14:44:43 360

原创 HDU 1539 2^x mod n = 1 (欧拉函数)

Problem DescriptionGive a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1.InputOne positive integer on each line, the value of n.OutputIf the minimum x exists, p

2016-01-28 14:01:09 438

原创 51nod 1435 位数阶乘 (简单题)

X是一个n位数的正整数 (x=a0a1...an−1) 现在定义 F(x)=∏i=0n−1(ai!)  , 比如F(135)=1!*3!*5!=720.我们给定一个n位数的整数X(至少有一位数大于1,X中可能有前导0),然后我们去找一个正整数(s)符合以下条件:1.这个数尽可能大,2.这个数中不能含有数字0或1。3.F(s)=F(x)

2016-01-26 19:57:20 445

原创 51nod 1416 两点 (dfs)

福克斯在玩一款手机解迷游戏,这个游戏叫做”两点”。基础级别的时候是在一个n×m单元上玩的。像这样: 每一个单元有包含一个有色点。我们将用不同的大写字母来表示不同的颜色。这个游戏的关键是要找出一个包含同一颜色的环。看上图中4个蓝点,形成了一个环。一般的,我们将一个序列 d1,d2,...,dk 看成一个环,当且仅当它符合下列条件时:1.    这k个点不一样,

2016-01-25 21:47:24 951

原创 51nod 1441 士兵的数字游戏 (模拟线性筛)

两个士兵正在玩一个游戏,游戏开始的时候,第一个士兵为第二个士兵选一个正整数n。然后第二个士兵要玩尽可能多的轮数。每一轮要选择一个正整数x>1,且n要是x的倍数,然后用n/x去代替n。当n变成1的时候,游戏就结束了,第二个士兵所得的分数就是他玩游戏的轮数。为了使游戏更加有趣,第一个士兵用 a! / b! 来表示n。k!表示把所有1到k的数字乘起来。那么第二个士兵所能得到的最大分数是多

2016-01-25 18:19:27 401

原创 HDU 1098 (数学_特殊值+抽屉原理)

题目大意:方程f(x)=5*x^13+13*x^5+k*a*x;输入任意一个数k,是否存在一个数a,对任意x都能使得f(x)能被65整出。现假设存在这个数a ,因为对于任意x方程都成立所以,当x=1时f(x)=18+ka又因为f(x)能被65整出,故设n为整数可得,f(x)=n*65;即:18+ka=n*65;因为n为整数,若要方程成立则问题转化为,对于给定范围的a

2016-01-22 22:02:52 407

原创 HDU 1087 lcs变形 (简单DP)

Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to

2016-01-21 14:42:11 386

原创 HDU 1084 What Is Your Grade? (模拟题)

题意:ac 5题,100分ac 4题,排名前50% 95分,其余 90分。。。。。。。。。。。。ac 0题,50分Problem Description“Point, point, life of student!”This is a ballad(歌谣)well known in colleges, and you must care

2016-01-21 14:19:12 454

原创 HDU 1081 最大子矩阵(LCS_DP+前缀和)

Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or greater located within the whole array. The sum of a rectangle is the sum

2016-01-18 21:11:04 429

原创 HDU 1076 (闰年判断)

Problem DescriptionIgnatius was born in a leap year, so he want to know when he could hold his birthday party. Can you tell him?Given a positive integers Y which indicate the start year, and a

2016-01-17 18:28:36 488

原创 HDU 1075 翻译 (字典树||map)

Problem DescriptionIgnatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it lea

2016-01-17 18:01:58 318

原创 HDU 1074 课程安排 (状态压缩+DP,经典)

题意:有n门课,每门课有截止时间和完成所需的时间,如果超过规定时间完成,每超过一天就会扣1分,问怎样安排做作业的顺序才能使得所扣的分最小贪心策略首先排除输入:53a 1 1b 2 1c 1 1你的输出:2acb正确答案:2abcProblem DescriptionIgnatius has just come back school f

2016-01-17 12:45:29 308

原创 HDU 1073 Online Judge (字符串处理,格式判断的好题!!!!)

Problem DescriptionIgnatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user's result file

2016-01-17 00:10:46 663

原创 hdu 1069 放长方体 (DP)

Sample Input110 20 3026 8 105 5 571 1 12 2 23 3 34 4 45 5 56 6 67 7 7531 41 5926 53 5897 93 2384 62 6433 83 270 Sample OutputCase 1: maximum height = 40Case 2:

2016-01-16 15:52:09 345

原创 HDU 1062 字符串翻转 (水题)

Problem DescriptionIgnatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them. Input

2016-01-15 15:57:37 446

原创 HDU 1056 HangOver (简单数学题)

题意:意思就是 你输入一个长度,问你最少用几张卡片能 让伸出去的长度大于等于你输入的长度.公式题目题目上面有Problem DescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can create a maximum over

2016-01-15 14:16:26 2327

原创 HDu 1058 丑数 (打表||DP,好题啊!!!)

题意:若一个数的所有素因子是2、3、5、7中的一个或多个,则这个数成为Humble数。求第n个Humble数是多少。Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8

2016-01-15 13:51:03 387

原创 蓝桥 分糖果 (模拟)

问题描述  有n个小朋友围坐成一圈。老师给每个小朋友随机发偶数个糖果,然后进行下面的游戏:  每个小朋友都把自己的糖果分一半给左手边的孩子。  一轮分糖后,拥有奇数颗糖的孩子由老师补给1个糖果,从而变成偶数。  反复进行这个游戏,直到所有小朋友的糖果数都相同为止。  你的任务是预测在已知的初始糖果情形下,老师一共需要补发多少个糖果。输入格式 

2016-01-13 19:20:07 404

空空如也

空空如也

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

TA关注的人

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