数学
断弦
这个作者很懒,什么都没留下…
展开
-
FZU 1607:Greedy division
Problem 1607 Greedy division Accept: 339 Submit: 1301Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionOaiei has inherited a large sum of wealth recently; this tre原创 2012-02-27 22:07:32 · 471 阅读 · 0 评论 -
2012 Multi-University Training Contest 5:Mark the Rope
Problem DescriptionEric has a long rope whose length is N, now he wants to mark on the rope with different colors. The way he marks the rope is:1. He will choose a color that hasn’t been used2原创 2012-08-08 20:16:35 · 659 阅读 · 0 评论 -
2012 Multi-University Training Contest 5:Xiao Ming's Hope
Problem DescriptionXiao Ming likes counting numbers very much, especially he is fond of counting odd numbers. Maybe he thinks it is the best way to show he is alone without a girl friend. The day原创 2012-08-08 19:18:25 · 828 阅读 · 0 评论 -
2012 Multi-University Training Contest 5:History repeat itself
Problem DescriptionTom took the Discrete Mathematics course in the 2011,but his bad attendance angered Professor Lee who is in charge of the course. Therefore, Professor Lee decided to let Tom原创 2012-08-08 19:45:36 · 492 阅读 · 0 评论 -
Developing School's Contest 2012-2 by HUT :数字游戏续
Problem Description自从小艾上次在和小牛的游戏中取得了信心之后,这次他又想到了一个问题,他要去计算两个数A和B的最大公约数。由于这两个数非常的大,于是小牛把数字A拆成了N个数,这N个数相乘的结果是A,把B拆成了M个数,同样这M个数的乘积等于B,小艾迫不及待地想去计算出这两个数的最大公约数,这次你能帮帮他吗?如果结果超过了9位数,输出最后的9位数。原创 2012-07-25 09:57:40 · 826 阅读 · 0 评论 -
SGU 499:Greatest Greatest Common Divisor
Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u SubmitStatusPractice SGU 499 DescriptionAndrew has just made a breakthrough in sociology: he realized ho原创 2012-07-11 19:30:49 · 1797 阅读 · 0 评论 -
FZU 1969 GCD Extreme,UESTC 1723 吴神的大脑: _数论好题(求1-n中所有数的最大公约数之和)
Problem DescriptionGiven the value of N, you will have to find the value of G. The meaning of G is given in the following codeG=0; for(i=1;i for(j=i+1;j G+=gcd(i,j);原创 2012-08-09 15:20:23 · 8191 阅读 · 4 评论 -
SPOJ :Use of Function Arctan
DescriptionIt's easy to know that arctan(1/2)+arctan(1/3)=arctan(1).The problem is,to some fixed number A,you have to write a program to calculate the minimum sum B+C.A,B and C are all positive原创 2012-08-09 16:44:11 · 1188 阅读 · 0 评论 -
SPOJ Primitive Root :判断一个数模p的阶是否是p-1
DescriptionIn the field of Cryptography, prime numbers play an important role. We are interested in a scheme called "Diffie-Hellman" key exchange which allows two communicating parties to ex原创 2012-08-10 10:39:46 · 1741 阅读 · 0 评论 -
SPOJ Equation :求 1/n!=1/x+1/y 的解的个数
DescriptionYou are given integer positive number N. Find the number of solutions in positive integer numbers of the following equation:1/N! = 1/X + 1/YInputEach line of input fil原创 2012-08-10 20:14:21 · 3249 阅读 · 0 评论 -
SPOJ—Paying in Byteland
DescriptionThere are infinitely many coin denominations in the Byteland. They have values of 2^i for i=0,1,2,... . We will say that set of coins c1,c2,...,ck is perfect when it is possible to pay原创 2012-08-10 21:48:38 · 1302 阅读 · 0 评论 -
UESTC 1721:吴神,人类的希望_n个相同的球放进m个相同的盒子的问题
Description公元18906416年,由于歌者无节制的使用二向箔,整个宇宙都将不可避免的跌入二次元。为了拯救学弟们,吴神决定使用一种叫smxrwzdx的基本粒子创造一个新的宇宙,吴神发现,用不同数量的smxrwzdx可以组合成不同的粒子,比如用两个smxrwzdx就可以组成一个魔理沙,三个smxrwzdx就可以组成一个洛天依,总之,无论怎样组合,都会产生一个好的结果(不要吐槽,吴神就是原创 2012-08-14 14:30:22 · 8445 阅读 · 1 评论 -
2012 Multi-University Training Contest 3:Arcane Numbers 1
Problem DescriptionVance and Shackler like playing games. One day, they are playing a game called "arcane numbers". The game is pretty simple, Vance writes down a finite decimal under base A, and原创 2012-08-13 19:43:42 · 574 阅读 · 0 评论 -
UVA - 10650 :Determinate Prime
Description Determinate PrimeInput: standard inputOutput: standard outputTime Limit: 1 second If three or more consecutive primes are uni-distance they are called Determinate Primes.原创 2012-08-16 14:58:46 · 846 阅读 · 0 评论 -
2012 Multi-University Training Contest 7:Palindrome graph
Problem DescriptionIn addition fond of programing, Jack also loves painting. He likes to draw many interesting graphics on the paper.One day,Jack found a new interesting graph called Palindrome原创 2012-08-15 20:31:58 · 586 阅读 · 0 评论 -
HDU 4291:A Short problem_成都赛区网络赛—矩阵快速幂
Problem Description According to a research, VIM users tend to have shorter fingers, compared with Emacs users. Hence they prefer problems short, too. Here is a short one: Given n (1 18), Y原创 2012-09-17 19:54:40 · 1818 阅读 · 0 评论 -
ZOJ 3645 :BiliBili _高斯消元
Shirai Kuroko is a Senior One student. Almost everyone in Academy City have super powers, andKuroko is good at using it. Her ability is "Teleporting", which can make people to transfer in the eleven原创 2012-10-11 19:50:26 · 1176 阅读 · 0 评论 -
Developing School's Contest 2012-2 by HUT:数字游戏
Problem Description小艾和小牛在上数学课的时候觉得非常的无聊,于是他们想出了一个新的游戏,小牛写下N位的数字,小艾的任务就是在去除了K位后得到一个最大的数。Input输入有多组数据。第一行输入一个N和一个K( 1 接下来就是N位数字,确保输入数据中没有前导0。Output输出去除了K位后的最大数字。Sample Inpu原创 2012-07-25 09:48:53 · 901 阅读 · 0 评论 -
UVA - 11666 Logarithms
From time immemorial different series has been an integrated part of mathematics. Series is very important for finding values of many important functions such as sin(x), ex, ln(x) etc. The well known原创 2012-07-25 09:14:19 · 652 阅读 · 0 评论 -
HDU 4135:Co-prime 容斥原理求(1,m)中与n互质的数的个数
Co-primeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 121 Accepted Submission(s): 56Problem DescriptionGiven a number N, you ar原创 2012-02-28 21:28:25 · 5896 阅读 · 4 评论 -
容斥原理(转载http://www.cppblog.com/vici/archive/2011/09/05/155103.html)
这篇文章发表于http://e-maxx.ru/algo/inclusion_exclusion_principle,原文是俄语的。由于文章确实很实用,而且鉴于国内俄文资料翻译的匮乏,我下决心将其翻译之。由于俄语对我来说如同乱码,而用Google直接翻译中文的话又变得面目全非,所以只能先用Google翻译成英语,再反复读,慢慢理解英语的意思,实在是弄得我头昏脑胀。因此在理解文章意思然后翻译成中文的转载 2012-02-28 19:36:09 · 3131 阅读 · 0 评论 -
SOJ 3137: Simple Computing _容斥原理
Time Limit: 2000 MS Memory Limit: 65536 KDescriptionGiven n integers x1 x2 ... xn, you should count how many intergers from 1 to m that can be divided by at least one of them.InputThe first原创 2012-02-28 22:11:52 · 700 阅读 · 0 评论 -
HDU 1695:GCD _容斥原理
GCDTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2474 Accepted Submission(s): 902Problem DescriptionGiven 5 integers: a, b, c,原创 2012-03-02 19:15:16 · 1865 阅读 · 0 评论 -
POJ 3904:Sky Code _容斥原理
Sky CodeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 585 Accepted: 163DescriptionStancu likes space travels but he is a poor software developer and wil原创 2012-03-02 21:26:45 · 2599 阅读 · 1 评论 -
FZU 1753:Another Easy Problem _素因子分解
Problem 1753 Another Easy Problem Accept: 268 Submit: 1302Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description小TT最近学习了高斯消元法解方程组,现在他的问题来了,如果是以下的方程,那么应该如何解呢?C(n1,m1)原创 2012-03-05 19:15:18 · 917 阅读 · 1 评论 -
扩展欧几里得学习
(转载:http://www.cnblogs.com/ka200812/archive/2011/09/02/2164404.html)首先、扩展欧几里得定理:对于两个不全为0的整数a、b,必存在一组解x,y,使得ax+by==gcd(a,b);实现如下:int gcd(int a,int b){ int t,d; if(b==0) { x=1转载 2012-03-08 20:40:36 · 523 阅读 · 0 评论 -
POJ 1061:青蛙的约会_扩展欧几里得
青蛙的约会Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 68075 Accepted: 10947Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止原创 2012-03-08 21:35:47 · 602 阅读 · 0 评论 -
POJ 2142:The Balance_扩展欧几里得
The BalanceTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 2378 Accepted: 1041DescriptionMs. Iyo Kiffa-Australis has a balance and only two kinds of weigh原创 2012-03-09 19:16:39 · 1609 阅读 · 5 评论 -
HDU 2855:Fibonacci Check-up_斐波拉契问题
Fibonacci Check-upTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 672 Accepted Submission(s): 370Problem DescriptionEvery ALPC ha原创 2012-03-12 21:24:13 · 1277 阅读 · 0 评论 -
【扩展Baby Step Giant Step解决离散对数问题】(转自AC神牛。。。。)
原创帖!转载请注明作者 AekdyCoin !【普通Baby Step Giant Step】【问题模型】求解A^x = B (mod C) 中 0 【思路】我们可以做一个等价x = i * m + j ( 0 而这么分解的目的无非是为了转化为:(A^i)^m * A^j = B ( mod C)之后做少许暴力的工作就可以解决问题:(1转载 2012-03-29 21:03:09 · 1074 阅读 · 0 评论 -
高斯消元法(Gauss Elimination) 分析 & 题解 & 模板——czyuan原创
//最近一直在做一个数论专题,后期有待整理,先将有关资料收藏下,在学习高斯消元的时候看了czyuan大牛的此文获益匪浅,czyuan的此份模板可以解决大多高斯问题,当然并不是万能的,其中建立矩阵是难点,需要自己琢磨,并且对于方程组是否有解、解的个数以及自由元等问题也需要自己做题慢慢思考,自己做了两三道题前前后后在建矩阵以及对一些解的问题在Gauss函数中改了几十次,逐渐摸索,还不算掌握的好,有待再转载 2012-03-29 21:09:58 · 18823 阅读 · 0 评论 -
学院OJ 1832: GCD(k, n)>=m
Description给你两个数n和m,找出在1-n之间有多少个k,使得GCD(k, n)>=mInput第一行是t,表示有多少组测试数据接下来有t行,每行一个n和m (1Output对于每组数据输出仅一行,输出符合要求的数的个数。Sample Input31 110 210000 72Sample Output1原创 2012-05-21 19:03:21 · 1096 阅读 · 0 评论 -
学院OJ 1619:中位数
Description给你N个正整数,如果每两两做差再取绝对值,将会得到M = N*(N-1)/2 个数,再将这M个数进行排序,你能很快求出中间的那个数吗?注意:中间那个数意味着:1、如果M为偶数,则意味着排序后的第M/2个数;2、如果M为奇数,则意味着排序后的第M/2 + 1个数。例如:如果M=6,则为第3个数,如果M=15,则为第8个数。Input多组输入,输入包括原创 2012-05-21 18:59:10 · 641 阅读 · 0 评论 -
SGU 441:Set Division _第二类斯特林数
DescriptionRuslan has K friends. And all of them have birthday tomorrow. He has boughtN different photo albums yesterday, and wants to present these photo albums to his friends. Of course, he原创 2012-07-17 10:24:16 · 5936 阅读 · 1 评论 -
UVA - 10025 :The ? 1 ? 2 ? ... ? n = k problem
The problemGiven the following formula, one can set operators '+' or '-' instead of each '?', in order to obtain a given k? 1 ? 2 ? ... ? n = k For example: to obtain k = 12 , the expression to原创 2012-08-06 09:23:57 · 1720 阅读 · 0 评论 -
2012 ACM-ICPC Asia Changchun Regional Contest - K:Yukari's Birthday
Today is Yukari's n-th birthday. Ran and Chen hold a celebration party for her. Now comes the most important part, birthday cake! But it's a big challenge for them to placen candles on the top of th原创 2012-10-18 20:38:01 · 1672 阅读 · 0 评论