
ACM_数学
文章平均质量分 77
HQD因为有趣所以做题
这个作者很懒,什么都没留下…
展开
-
hdu 3625 Examining the Rooms //组合数学DP
做的十分顺利,1Y#include #include long long dp[21][21];double ans[21][21];double out[21][21];long long sum = 0;int main(){ memset(原创 2011-08-29 16:19:19 · 1319 阅读 · 0 评论 -
zju 3526 Weekend Party
每次浙大月赛都打酱油,中午这种题,愣是把数字敲错了。。。。。。。#include #include int num[10];char s[20], s2[10];int t[10];int main(){ int n; whil原创 2011-08-28 22:36:13 · 673 阅读 · 0 评论 -
hdu 3921 Clear All of Them II
可能大家都坑在第一题上了,导致这个比较水的题都不做了#include #include #include #include using namespace std;struct Point{ double x, y;} node[201];st原创 2011-08-12 18:51:33 · 858 阅读 · 0 评论 -
hdu 3925 substring
比赛时候脑子堵得慌,注意进位,这两场比赛都发挥的很不好#include #include #include using namespace std;//////////////////////////////////////#define MAX 10000原创 2011-08-12 10:31:39 · 845 阅读 · 0 评论 -
hdu 3714 Error Curves
去年成都赛区的一道题目,画几个图能YY出事凸函数,接着就是三分解#include #include #include using namespace std;const int N = 10002;const double eps = 1e-10;//开成-8就错了原创 2011-08-09 20:10:42 · 870 阅读 · 0 评论 -
hdu 3884 Hinanai Tenshi’s peach garden
比赛的时候卡题了,这题当时没有看。。。。。题意比较简单,不介绍了简单整理整理思想吧,有些细节的东西是看了标程才明朗起来。题目要求答案是最多收集几个桃子。这种比较容易想到是二分10^4的数据,必须是0(nlgn)以下的算法,二分的话就已经是0(lgn)了,所以下面的验证需要0(n)原创 2011-07-29 14:45:11 · 1158 阅读 · 2 评论 -
BUPT 201 Glorious Array
北邮邀请赛的题目,比赛的时候思路很乱,现在整理下吧。网上已经给出了有公式解法,我这里还是说说树状数组的解法吧题目只有两个操作,一个是将一个点的颜色取反,一个是询问有多少个端点颜色不同并且包含小于k的区间。总体思路是这样首先是用树状数组保存每个点的颜色,如果是1,那个点加1,这是初原创 2011-07-22 09:32:49 · 517 阅读 · 0 评论 -
hdu 3862 The Lost Traveler
昨天悲剧的卡在这题上了和秦牛推出很多个版本的解法就是蛋疼的不过其实思路是比较简单的就是昨天想的那个关键点,就是把这些方向可以看成力矩一样的东西,也就是矢量吧。如果中间能回到原点,那么后面不管有任何操作,都能回到原点的用一句比较简洁的话概括,就是如果所有的向量都不位于任何一条直线的原创 2011-07-20 15:19:19 · 980 阅读 · 0 评论 -
hdu 3830 Checkers
这题目的解法果然是很难想到有一个突破点就是任何一个状态,通过题目所给的移动,都能对应且唯一对应一个b*2=a+c(a所以以这个为根如果不是根的状态,可以让左右两个往里跳,依据是让和中间那个坐标距离缩小这样就可以看作为是向根移动具体的操作用的是辗转相除法的思想接着找初始状态和目标状原创 2011-07-14 10:13:41 · 1157 阅读 · 0 评论 -
hdu 3434 Sequence Adjustment
Sequence AdjustmentTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 477原创 2011-07-03 15:30:36 · 1464 阅读 · 0 评论 -
递推题目大整理
我是被逼的,做这种鸟递推//HDU 2524 //行列相乘,先处理行的情况,接着把一行看成一个元素#includeint main(){ int n,m,t; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); int sum=(n*(n+1))>>1; int k=(m*(m+1))>>1; printf("%d/n",sum*k原创 2011-03-31 21:41:00 · 1104 阅读 · 0 评论 -
poj 2244 Eeny Meeny Moo
<br /> Eeny Meeny MooTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2150 Accepted: 1459<br />DescriptionSurely you have made the experience that when too many people use the Internet simultaneously, the net becomes very, very slow. <br />To put原创 2011-03-30 19:25:00 · 2181 阅读 · 1 评论 -
poj 1664 放苹果
<br />放苹果Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 16904 Accepted: 10656<br />Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。<br />Input第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。<br />Output对输原创 2011-03-30 11:23:00 · 873 阅读 · 0 评论 -
poj 2549 Sumsets
<br /> SumsetsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6261 Accepted: 1745<br />DescriptionGiven S, a set of integers, find the largest d such that a + b + c = d where a, b, c, and d are distinct elements of S. <br />InputSeveral S, ea原创 2011-03-30 10:59:00 · 1551 阅读 · 0 评论 -
poj 2229 Sumsets
<br />SumsetsTime Limit: 2000MS Memory Limit: 200000KTotal Submissions: 8611 Accepted: 3461<br />DescriptionFarmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer原创 2011-03-30 10:58:00 · 1707 阅读 · 0 评论 -
poj 2506
<br />TilingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5487 Accepted: 2676<br />DescriptionIn how many ways can you tile a 2xn rectangle by 2x1 or 2x2 tiles? <br />Here is a sample tiling of a 2x17 rectangle. <br /><br />InputInput is a se原创 2011-03-30 10:57:00 · 1371 阅读 · 0 评论 -
POJ 1496 1850
<br /> <br /> <br /> <br />//递推#include<cstdio>#include<iostream>#include<string>using namespace std;int dp[30][30];//长度为iint sum[30];void init(){ for(int i=1;i<=26;i++) dp[1][i]=1; sum[1]=26; for(int i=2;i<=10;i++) fo原创 2011-03-30 10:56:00 · 713 阅读 · 0 评论 -
1032 Parliament
ParliamentTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 12309 Accepted: 5124<br />DescriptionNew convocation of The Fool Land's Parliament consists of N delegates. According to the present regulation delegates should be divided into disjoint gr原创 2011-02-25 09:53:00 · 1058 阅读 · 0 评论 -
1019 Number Sequence
Number SequenceTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 22588Accepted: 6019<br />DescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2.原创 2011-02-24 15:19:00 · 703 阅读 · 0 评论 -
1013 Counterfeit Dollar
Counterfeit DollarTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 27942Accepted: 8742<br />DescriptionSally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true silver dollars; one coin is counterfeit e原创 2011-02-24 11:28:00 · 884 阅读 · 0 评论 -
1017 Packets
PacketsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 28741Accepted: 9462<br />DescriptionA factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are al原创 2011-02-24 10:07:00 · 1219 阅读 · 0 评论 -
2409 Let it Bead //polya 定理
Let it BeadTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2209 Accepted: 1363<br />Description"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 P原创 2011-02-12 16:09:00 · 944 阅读 · 0 评论 -
hdu 1005 矩阵乘法
<br /> Number Sequence<br />Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)<br />Total Submission(s): 37082 Accepted Submission(s): 7790<br />Problem DescriptionA number sequence is defined as follows:<br /><br原创 2011-02-04 15:37:00 · 1430 阅读 · 0 评论 -
hdu A + B Problem II
<br />A + B Problem IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)<br />Total Submission(s): 71329 Accepted Submission(s): 13022<br /><br /><br />Problem DescriptionI have a very simple problem for you. Given原创 2011-02-03 18:50:00 · 1714 阅读 · 0 评论 -
hdu 3477 Temperature
<br /> Temperature<br />Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)<br />Total Submission(s): 393 Accepted Submission(s): 143<br /><br />Problem DescriptionMany people like summer as summer has a lot of advantages原创 2010-10-06 19:22:00 · 976 阅读 · 0 评论 -
hdu 2446 Shell Pyramid //二分+二分
<br />Shell PyramidTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)<br />Total Submission(s): 1008 Accepted Submission(s): 364<br /><br /><br />Problem DescriptionIn the 17th century, with thunderous noise, dense smoke原创 2010-10-02 19:16:00 · 1068 阅读 · 0 评论 -
POJ 1200 Crazy Search //HASH
<br />Crazy SearchTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12290 Accepted: 3339<br />DescriptionMany people like to solve hard puzzles some of which may lead them to madness. One such puzzle could be finding a hidden prime number in a give原创 2010-09-25 21:41:00 · 634 阅读 · 0 评论 -
POJ 2739 Sum of Consecutive Prime Numbers
Sum of Consecutive Prime NumbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9435 Accepted: 5407<br />DescriptionSome positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a原创 2010-09-23 14:11:00 · 585 阅读 · 0 评论 -
poj 2719 Faulty Odometer
<br /><br />Faulty OdometerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7042 Accepted: 4375<br />DescriptionYou are given a car odometer which displays the miles traveled as an integer. The odometer has a defect, however: it proceeds from th原创 2010-09-23 10:54:00 · 1431 阅读 · 1 评论 -
1003 Square Root
<br />大数平方<br />#include<stdio.h>#include<string.h>#include<math.h>int big(char s1[],char s2[]){ int len1,len2,i,q; q=0; while(s1[q]=='0') q++; strcpy(s1,s1+q); if(strlen(s1)==0) { s1[0]='0'; s1[1]=0;原创 2010-09-13 18:37:00 · 905 阅读 · 0 评论 -
Max Angle //2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU
Max Angle Time Limit : 4000/2000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 12 Accepted Submission(s) : 5Font: Times New Roman | Verdana | GeorgiaFont Size: ←→Problem DescriptionGiven many points in a plane, two player原创 2010-08-29 19:26:00 · 825 阅读 · 0 评论 -
3904 - Tile Code Asia - Seoul - 2007/2008
3904 - Tile CodeAsia - Seoul - 2007/2008PDF Submit RankingThe city of Songpa is now carrying out a project to build a bicycle transportation system called 鈥榞reen Songpa.鈥?By the end of this year, citizens and visitors alike will be able to pick up and drop原创 2010-08-14 20:12:00 · 1127 阅读 · 0 评论 -
POJ 2109
<br />很无语<br />#include<stdio.h><br />#include<math.h><br />int main()<br />{<br /> double x,y;<br /> while(scanf("%lf%lf",&x,&y)!=EOF)<br /> printf("%.0lf/n",pow(y,1/x));<br /> return 0;<br />}原创 2010-08-08 10:17:00 · 792 阅读 · 0 评论 -
3737 UmBasketella
<br /><br />UmBasketellaTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3677 Accepted: 1381<br />Description<br />In recent days, people always design new things with multifunction. For instance, you can not only use cell phone to call your fri原创 2010-07-16 21:30:00 · 622 阅读 · 0 评论 -
3070 Fibonacci 矩阵乘法
<br />FibonacciTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3502 Accepted: 2450<br />Description<br />In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, the first ten terms of the Fibonacci sequ原创 2010-07-16 19:35:00 · 942 阅读 · 0 评论 -
3233 Matrix Power Series 矩阵乘法
<br /><br />Matrix Power SeriesTime Limit: 3000MS Memory Limit: 131072KTotal Submissions: 5442 Accepted: 2322<br />Description<br />Given a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak.<br />Input<br />The input contains e原创 2010-07-16 19:33:00 · 522 阅读 · 0 评论 -
POJ Prime Distance
<br /><br /> Prime DistanceResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K4617StandardThe branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thous原创 2010-07-11 21:53:00 · 740 阅读 · 1 评论 -
POJ3641 Pseudoprime numbers(快速幂取模)
<br /><br />Pseudoprime numbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3171 Accepted: 1105<br />Description<br />Fermat's theorem states that for any prime number p and for any integer a > 1, ap = a (mod p). That is, if we raise a to the原创 2010-07-10 23:27:00 · 1315 阅读 · 0 评论 -
POJ 1365 Prime Land
<br /><br />#include<stdio.h><br />#include<string.h><br />char str[1001];<br />int a[100],b[100];<br />bool isprime[33000];<br />void Make()<br />{<br /> int i,j;<br /> memset(isprime,true,sizeof(isprime));<br /> isprime[0] = isprime[1]原创 2010-07-10 22:21:00 · 661 阅读 · 0 评论 -
2640: More Vertexes, More Area
#includeint main(){ int temp,m,n,s; while(scanf("%d%d",&m,&n)!=EOF) { if(m==0&&n==0) break; if(m==1||n==1) printf("0/n"); else if(m==2||n==2) { if(n!=2) printf("%d/n",n-1); if(m!=2) prin原创 2010-04-20 22:03:00 · 529 阅读 · 0 评论