
数学
u010660276
这个作者很懒,什么都没留下…
展开
-
leetcode 回文数
题目描述:判断一个整数是否是回文数。回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数。示例 1:输入: 121输出: true示例 2:输入: -121输出: false解释: 从左向右读, 为 -121 。 从右向左读, 为 121- 。因此它不是一个回文数。示例 3:输入: 10输出: false解释: 从右向左读, 为 01 。因此...原创 2018-08-01 21:58:11 · 350 阅读 · 0 评论 -
uva 11077 - Find the Permutations(置换+dp)
题意:对于1~n的排列,至少交换k次才能变成1,2,3,...,n的有多少个思路:假设每一个排列是一个置换,这个置换里有x个循环,那么这个置换想变成1,2,3,...,n至少交换n-x次,所以题意也就是有多少个排列,里面的循环这个可以有dp来做,dp[i][j]表示至少交换j次,变成1,2,...,idp[i][j]=dp[i-1][j]+dp[i-1][j-1]*(i-1)dp[原创 2015-05-18 16:37:19 · 462 阅读 · 0 评论 -
2015百度之星初赛第二场(1005 dp,1004 数学)
序列变换 Accepts: 695 Submissions: 3322 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description我们有一个数列A1,A2...An,你现在要求修改数量最少的原创 2015-05-31 18:56:26 · 1326 阅读 · 3 评论 -
Codeforces Round #305 (Div. 2)C. Mike and Frog 数学(循环节)
C. Mike and FrogMike has a frog and a flower. His frog is named Xaniar and his flower is named Abol. Initially(at time0), height of Xaniar is h1 and height of Abol ish2. Each second, Mike原创 2015-05-27 20:35:41 · 564 阅读 · 0 评论 -
Codeforces Round #305 (Div. 1)C. Mike and Foam 数学
C. Mike and Foamtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMike is a bartender at Rico's bar. At Rico's, they p原创 2015-05-27 16:30:35 · 741 阅读 · 0 评论 -
数学(hdu5212)
CodeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 319 Accepted Submission(s): 128Problem DescriptionWLD likes playing with code原创 2015-05-07 10:23:10 · 443 阅读 · 0 评论 -
数学(hdu3208 - Integer’s Power)
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2015-05-03 20:04:32 · 1072 阅读 · 0 评论 -
Lucas定理+乘法逆元+组合数学(hdu5226)
Tom and matrixTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 189 Accepted Submission(s): 57Problem DescriptionTom was on the way原创 2015-05-11 10:27:20 · 729 阅读 · 0 评论 -
数学(乘法逆元)hdu5225
Tom and permutationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 201 Accepted Submission(s): 87Problem DescriptionTom has learn原创 2015-05-10 22:16:07 · 864 阅读 · 0 评论 -
数学(快速幂+快速加法 hdu5187-zhx's contest)
zhx's contestTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 562 Accepted Submission(s): 177Problem DescriptionAs one of the most原创 2015-03-15 10:55:20 · 801 阅读 · 0 评论 -
hdu 5080 - Colorful Toy(2014 AnShan)几何+polya
Colorful ToyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 304 Accepted Submission(s): 100Problem DescriptionA toy is made up原创 2015-05-18 21:31:18 · 643 阅读 · 0 评论 -
hdu - 5239 Doom(线段树+数论)
DoomTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 426 Accepted Submission(s): 96Problem DescriptionTHE END IS COMINGGGGGG!原创 2015-06-04 22:14:58 · 1196 阅读 · 0 评论 -
hdu - 5238 Calculator(线段树+中国剩余定理)线段树好题
原来还不知道中国剩余定理能干什么用,先上几篇中国剩余定理的介绍下面内容转自:http://wenku.baidu.com/link?url=g1Hiu6UtSoOR6Y3tiHpn5M3_HPnuoTN_xpm1GPFHAkZB-nW0m61vunMmNIqxacAke3jPmMvE_M4gWGd25D0C1ZthZTuzx-u1DHSbunP8qrS“中国剩余定理”算理及其应原创 2015-06-06 13:33:33 · 1199 阅读 · 0 评论 -
2015 Multi-University Training Contest 4(hdu5334 - Virtual Participation)数学
Virtual ParticipationProblem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he asks rikka to have some practice on codeforces. Then she opens the problem B:Give原创 2015-08-01 16:58:08 · 578 阅读 · 0 评论 -
2015 Multi-University Training Contest 3(hdu 5316、5317、5319、5323、5325、5326)线段树+数学+yy+矩阵快速幂
MagicianProblem DescriptionFantasy magicians usually gain their ability through one of three usual methods: possessing it as an innate talent, gaining it through study and practice, or receiving it fro原创 2015-07-28 18:28:50 · 696 阅读 · 0 评论 -
ZOJ 3547 - The Boss on Mars(容斥)
The Boss on MarsOn Mars, there is a huge company called ACM (A huge Company on Mars), and it’s owned by a younger boss.Due to no moons around Mars, the employees can only get the salaries per-year. The原创 2015-08-10 17:01:01 · 595 阅读 · 0 评论 -
Codeforces Round #317 [AimFund Thanks-Round] (Div. 1)(组合数学+容斥)
A. Lengthening SticksYou are given three sticks with positive integer lengths of a, b, and c centimeters. You can increase length of some of them by some positive integer number of centimeters (differe原创 2015-08-24 17:41:24 · 510 阅读 · 0 评论 -
hdu 5297 - Y sequence( 2015 Multi-University Training Contest 1)容斥原理
Y sequenceProblem DescriptionYellowstar likes integers so much that he listed all positive integers in ascending order,but he hates those numbers which can be written as a^b (a, b are positive integers转载 2015-07-27 23:35:23 · 473 阅读 · 0 评论 -
2013 ACM-ICPC吉林通化全国邀请赛(hdu 4493 - 4599)(并查集+dp+数学+判奇环+差分约束)
D-City Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 2437 Accepted Submission(s): 859Problem Description Luxer is a really bad guy. He d原创 2015-07-11 16:49:22 · 1154 阅读 · 0 评论 -
Codeforces Round #313 (Div. 2)E. Gerald and Giant Chess(Lucas定理+dp)
E. Gerald and Giant ChessGiant chess is quite common in Geraldion. We will not delve into the rules of the game, we’ll just say that the game takes place on an h × w field, and it is painted in two col原创 2015-07-25 16:12:28 · 697 阅读 · 0 评论 -
hdu 5288 - OO’s Sequence 数学
OO’s SequenceProblem Description OO has got a array A of size n ,defined a function f(l,r) represent the number of i (l<=i<=r) , that there’s no j(l<=j<=r,j<>i) satisfy ai mod aj=0,now OO want to know原创 2015-07-26 20:49:47 · 478 阅读 · 0 评论 -
2015百度之星资格赛
大搬家Accepts: 1516Submissions: 6288Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Problem Description近期B厂组织了一次大搬家,所有人都要按照指示换到指定的座位上。指示的内容是坐在位置i上原创 2015-05-26 08:06:35 · 928 阅读 · 0 评论 -
BestCoder Round #43 (hdu5264 - 5266)(数学,LCA)good
pog loves szh IAccepts: 497Submissions: 822Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)问题描述pog拥有很多字符串,它喜欢将两个长度相等字符串交错拼在一起,如abcd与efgh,那么交错拼在一起就成原创 2015-06-08 16:33:09 · 705 阅读 · 0 评论 -
数学(hdu5175Misaki's Kiss again)
Misaki's Kiss againTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 820 Accepted Submission(s): 205Problem DescriptionAfter the Fe原创 2015-02-24 16:10:38 · 788 阅读 · 0 评论 -
高斯消元(good)hdu4870
官方题解:令(x, y)表示高分为x,低分为y的状态(x >= y),E(x, y)表示从(x, y)到达(1000, ?)的比赛场数期望。容易得到E(x, y) = P * E(x1, y1) + (1 - P) * E(x2, y2) + 1,其中,(x1, y1)表示rating上升后的状态,(x2, y2)表示rating下降后的状态。每50分一个状态,共有210个状态(21*20/2原创 2014-12-26 19:23:58 · 524 阅读 · 0 评论 -
2014多校第五场
刚开始出的两个题还挺快的,结果后来就掉的原创 2014-08-07 19:19:02 · 625 阅读 · 0 评论 -
AC自动机+DP+大数poj1625
Language:DefaultCensored!Time Limit: 5000MS Memory Limit: 10000KTotal Submissions: 8102 Accepted: 2191DescriptionThe alphabet of Freeland consists of exac原创 2014-09-04 22:29:56 · 641 阅读 · 0 评论 -
hdu3723+Catalan数
题意 :在平面坐标系的第一象限上,从原点出发,到 (n, 0) 的种类。思路 : 卡塔兰数。c[n] = 2n! / ((n+1)! n!) = c(2n, n) / (n + 1) 因为始点与终点是水平的。 所以向上多少,向下就要多少,其余的都是水平前景的。 假设 上升了 k 次 那就必须下降 k 次 所以 a[k] = c(n, 2k) * c(2原创 2014-08-08 17:51:41 · 603 阅读 · 0 评论 -
AC自动机+矩阵(构造字符串 好)hdu2243
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-09-04 19:33:54 · 500 阅读 · 0 评论 -
2014 Multi-University Training Contest 9
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-08-19 19:31:57 · 515 阅读 · 0 评论 -
线段树Codeforces Round #163 (Div. 2)E
25431300input3 11000000000 1000000000 1000000000? 1 3 0output999999986题意:原创 2014-08-05 09:57:26 · 661 阅读 · 0 评论 -
数学spoj8063
I - Dividing StonesTime Limit:7000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice SPOJ AMR10IDescriptionThere are N stones, which can be divided int原创 2014-08-01 20:51:48 · 477 阅读 · 0 评论 -
线段树点更新+反素数+poj2777
反素数:对于任何正整数x,其约数的个数记做g(x).例如g(1)=1,g(6)=4.如果某个正整数x满足:对于任意i(0原创 2014-07-01 16:13:57 · 546 阅读 · 0 评论 -
莫比乌斯函数
在数论中的积性函数:对于正整数n的一个算术函数 f(n),若f(1)=1,且当a,b互质时f(ab)=f(a)f(b),在数论上就称它为积性函数。若对于某积性函数 f(n) ,就算a, b不互质,也有f(ab)=f(a)f(b),则称它为完全积性的。φ(n) -欧拉函数,计算与n互质的正整数之数目μ(n) -莫比乌斯函数,关于非平方数的质因子数目原创 2014-06-11 17:35:13 · 4573 阅读 · 0 评论 -
指数循环节
【关于 A^x = A^(x % Phi(C) + Phi(C)) (mod C) 的若干证明】【指数循环节】以下内容全部原创,转载请注明作者 : AekdyCoin 以及本文地址曾经看过如下一个公式:以上的公式如果第一次见到,难免有不少疑惑:为什么可以这么写?限制条件为什么是x >= Phi(C),这个公式为什么正确?今天突发奇想,在纸上YY以后得转载 2014-06-27 15:42:47 · 786 阅读 · 0 评论 -
线段树(待续)(区间每个数加上不同的斐波那契额数)Codeforces Round #FF (Div. 2)E
E. DZY Loves Fibonacci NumbersIn mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relationF1 = 1; F2 = 1; Fn = Fn - 1 + Fn - 2 (n > 2).DZY loves Fibo转载 2014-08-07 22:25:54 · 1326 阅读 · 0 评论 -
数学发现规律+hdu5014
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-09-14 20:37:06 · 599 阅读 · 0 评论 -
Codeforces Round #264 (Div. 2)(好)
C. Gargari and Bishopstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGargari is jealous that his friend Caisa won t原创 2014-09-03 14:28:42 · 497 阅读 · 0 评论 -
高斯消元+大数SGU200
Cracking RSATime Limit:250MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusDescription200. Cracking RSA time limit per test: 0.25 sec. memor原创 2014-12-25 18:59:34 · 519 阅读 · 0 评论 -
高斯消元解同余方程poj2947
Language:DefaultWidget FactoryTime Limit: 7000MS Memory Limit: 65536KTotal Submissions: 4689 Accepted: 1595DescriptionThe widget factory produces several原创 2014-12-20 13:37:56 · 521 阅读 · 0 评论