
ACM-数学
文章平均质量分 83
acm数学题
_txg
平凡,是为了最美的荡气回肠
展开
-
UVA - 12103 Leonardo's Notebook (置换乘法的应用)
传送门:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3255题解:LRJ训练之南p147说一下碎玉置换A=(a1 a2 a3)(b1 b2 b3 b4)的平方怎么得出来的:(a1 a2 a3)(a1 a2 a3)=>a1->a2->a3,a原创 2017-08-04 22:16:22 · 380 阅读 · 0 评论 -
poj 1850 Code
题目链接:点击打开链接DescriptionTransmitting and memorizing information is a task that requires different coding systems for the best use of the available space. A well known system is that one where a原创 2016-08-23 17:42:18 · 362 阅读 · 0 评论 -
poj 3292 Semi-prime H-numbers
题目链接:点击打开链接DescriptionThis problem is based on an exercise of David Hilbert, who pedagogically suggested that one study the theory of 4n+1 numbers. Here, we do only a bit of that.An H-number原创 2016-08-23 18:58:58 · 341 阅读 · 0 评论 -
poj 1019 Number Sequence
题目链接:点击打开链接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...Sk. Each group Sk consists of a原创 2016-08-23 19:05:33 · 382 阅读 · 0 评论 -
poj 1905 Expanding Rods
题目链接:点击打开链接DescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted on tw原创 2016-08-24 15:27:49 · 378 阅读 · 0 评论 -
poj 2635 The Embarrassed Cryptographer(同余模定理的应用)
题目链接:点击打开链接DescriptionThe young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of users, which is now in use in his company. The原创 2016-08-24 21:03:53 · 395 阅读 · 0 评论 -
常见数论定理(二)
(1) 整数的唯一分解定理: 任意正整数都有且只有一种方式写出其素因子的乘积表达式。 A=(p1^k1)*(p2^k2)*(p3^k3)*....*(pn^kn) 其中pi均为素数(2) 约数和公式:对于已经分解的整数A=(p1^k1)*(p2^k2)*(p3^k3)*....*(pn^kn)有A的所有因子之和为原创 2016-09-18 21:11:03 · 411 阅读 · 0 评论 -
poj 1845 Sumdiv (很多数论知识 ,很经典 )
题目链接:点击打开链接转载于:http://blog.youkuaiyun.com/lyy289065406/article/details/6648539大致题意:求A^B的所有约数(即因子)之和,并对其取模 9901再输出。 解题思路:要求有较强 数学思维 的题应用定理主要有三个:要求有较强 数学思维 的题应用定理主要有三个:转载 2016-09-19 12:18:27 · 391 阅读 · 0 评论 -
CodeForces - 2B -The least round way (dp math)
点击链接:http://codeforces.com/problemset/problem/2/BThere is a square matrix n × n, consisting of non-negative integer numbers. You should find such a way on it thatstarts in the upper left cell原创 2017-01-11 14:42:19 · 498 阅读 · 0 评论 -
poj 3252 Round Numbers
题目链接:点击打开链接DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host of原创 2016-08-23 17:15:49 · 384 阅读 · 0 评论 -
poj 3272 Monthly Expenset
题目链接:点击打开链接DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of mone原创 2016-08-16 21:54:24 · 317 阅读 · 0 评论 -
hdu - 6096 Counting Divisors (数论计算约数的个数+思路)
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6069Counting DivisorsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 977 Accepted原创 2017-08-03 21:44:52 · 712 阅读 · 0 评论 -
UVA - 10294 Arif in Dhaka (First Love Part 2) (置换群-polya定理- 数学推导循环节)
传送门:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1235题解:算法竞赛训练指南p147LRJ关于这个题还说有更简单的办法,用程序直接求置换的?求大牛路过的话请指点,万分感激!#include #include #include #原创 2017-08-03 10:44:27 · 349 阅读 · 0 评论 -
LightOj 1341 Aladdin and the Flying Carpet (素数筛+求一个数的约数个数)
传送门:http://lightoj.com/volume_showproblem.php?problem=1341It's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are conc原创 2017-08-02 17:11:48 · 358 阅读 · 0 评论 -
LightOj1356-Prime Independence
传送门:http://lightoj.com/login_main.php?url=volume_showproblem.php?problem=1356A set of integers is called prime independent if none of its member is a prime multiple of another member. An原创 2017-08-02 15:32:40 · 696 阅读 · 0 评论 -
HDU - 4291 A Short problem (矩阵快速幂+找循环节)
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4291A Short problemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2845 Accepted Subm原创 2017-08-09 08:47:14 · 321 阅读 · 0 评论 -
lightoj-1370 Bi-shoe and Phi-shoe( 欧拉筛 求 欧拉函数)
传送门:http://lightoj.com/volume_showproblem.php?problem=1370Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some b原创 2017-08-01 18:40:58 · 393 阅读 · 0 评论 -
sdut oj 2404 super prime(素数筛)
题目链接:点击打开链接题目大意:We all know, prime is a kind of special number which has no other factors except of 1 and itself.2,3,5,7,11,13,17,19,23,29 are the top 20 primes.Now there is a new question原创 2016-05-18 21:19:22 · 455 阅读 · 0 评论 -
poj 1942 Paths on a Grid
题目链接:点击打开链接DescriptionImagine you are attending your math lesson at school. Once again, you are bored because your teacher tells things that you already mastered years ago (this time he's expl原创 2016-08-16 21:42:50 · 423 阅读 · 0 评论 -
gcd-matrix
https://www.hackerrank.com/contests/hourrank-17/challenges/gcd-matrixAlex has two arrays defined as and . He created an matrix, , where for each in . Recall that is the greates原创 2017-02-10 20:04:26 · 358 阅读 · 0 评论 -
Beehive UVALive - 7528 (找规律+数学思维)
点击打开链接There is an infinite beehive like the one given in the figure. We consider two cells to be adjacent if andonly if they share a side. A path of length k from cell c0 to cell ck is a sequence of原创 2017-02-18 13:14:49 · 482 阅读 · 0 评论 -
Colossal Fibonacci Numbers! UVA - 11582 (数论,幂求模,规律周期)
直击题目:https://vjudge.net/problem/41990/origin题目大意:给出三个数,a,b,n;其中a,b题解:首先看到的是这个公式,f[i]=f[i-1]+f[i-2],那么假设f[a^b]=f[i]。而f[a^b]%n=f[i]%n=f[i-1]%n+f[i-2]%n.然后根据递推的关系可以看出,其实在求的过程中对每一个f[i]取模就可以了。当进行到这里的原创 2017-03-22 10:29:51 · 430 阅读 · 0 评论 -
<模板>(Miller-Rabin和Pollard_rho算法)poj 2429 GCD & LCM Inverse (数论)
本文出自http://blog.sina.com.cn/s/blog_69c3f0410100uac0.htmlps:我就把这个题当作(Miller-Rabin和Pollard_rho)算法的模板来储存了,回头再细学这两个算法。题意:给出两个整数 m、n ( m =思路:由题意,则令 p = a / m , q = b / m , s = n / m,则有GCD(p , q) = 1原创 2017-04-16 17:19:30 · 583 阅读 · 0 评论 -
2017省选拔(二)poj1981 Circle and Points (数学)
直接链接:点击打开链接You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be si原创 2017-04-19 10:37:33 · 659 阅读 · 0 评论 -
2017省组队练习 Number of Connected Components UVALive - 7638 (数论+并查集)
题目链接:点击打开链接Given N nodes, each node is labeled with an integer between 1 and 106(inclusive and labels arenot necessarily distinct). Two nodes have an edge between them, if and only if the GCD (Great原创 2017-04-19 13:58:05 · 603 阅读 · 0 评论 -
(one day one problem)poj 2800 Joseph's Problem (数学)
题目链接:点击打开链接DescriptionJoseph likes taking part in programming contests. His favorite problem is, of course, Joseph's problem. It is stated as follows. There are n persons numbered from原创 2017-04-19 14:22:24 · 370 阅读 · 0 评论 -
(one day one problem)SPOJ - PROD1GCD Product it again (GCD+分解质因子找思路)-数论
题目链接:https://cn.vjudge.net/problem/477808/originThe problem is very simple. given two integers n and m, find the product GCD(1, 1) * GCD(1, 2) * ... * GCD(1, M) * GCD(2, 1) * GCD(2, 2) * ... * GCD原创 2017-04-25 17:53:47 · 832 阅读 · 0 评论 -
(数论)素数和因式分解hdu-2136;hdu-1492;hdu-1215;hdu1452;hdu-1005;hdu-1852
HDU - 2136-http://acm.hdu.edu.cn/showproblem.php?pid=2136Everybody knows any number can be combined by the prime number. Now, your task is telling me what position of the largest prime factor.原创 2017-04-26 21:59:20 · 668 阅读 · 0 评论 -
HDU - 5245 Joyful (数学期望+求概率)
传送门:-->Sakura has a very magical tool to paint walls. One day, kAc asked Sakura to paint a wall that looks like an M×NM×N matrix. The wall has M×NM×N squares in all. In the whole problem we原创 2017-04-29 20:26:50 · 686 阅读 · 0 评论 -
HDU-1005- Number Sequence (矩阵快速幂)
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1005Number SequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 176250 Accepted Su原创 2017-07-28 11:36:47 · 431 阅读 · 0 评论 -
2017sdut省赛选拔(1)--poj2976(基础01分数规划)
http://poj.org/problem?id=2976Dropping testsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11826 Accepted: 4105DescriptionIn a certain course原创 2017-04-11 16:00:57 · 476 阅读 · 0 评论 -
2017sdut省赛选拔(1)--poj1284(原根问题+欧拉回路)
http://poj.org/problem?id=1284Primitive RootsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4271 Accepted: 2503DescriptionWe say that integer x原创 2017-04-11 11:04:52 · 392 阅读 · 0 评论 -
Contest - 2017年浙江理工大学程序设计竞赛校赛
点击:http://oj.acm.zstu.edu.cn/JudgeOnline/contest.php?cid=3650Problem A: 回文Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 1637 Solved: 505Description小王想知道一个字符串是否为ABA’型字符串。ABA’型字符原创 2017-03-22 15:30:09 · 2280 阅读 · 0 评论 -
Disgruntled Judge UVA - 12169 (数论 之 扩展欧几里得+模运算)
点击:https://vjudge.net/problem/24843/origin题目大意:有一个递推公式xi=(a*x(i-1)+b)mod10001,a然后给出一个T,x从1~2*T,输入x1,x3,x5,........。让输出满足公式的x2,x4,x6.......如果有多种答案,输出任意一组。题解:首先这个题通过暴力查找a,b就能过。(自己都没敢这样想,还是原创 2017-03-22 18:59:03 · 618 阅读 · 0 评论 -
Choose and divide UVA - 10375 (数论+唯一分解定理)
Choose and divide UVA - 10375 (数论+唯一分解定理)原创 2017-03-24 14:30:33 · 345 阅读 · 0 评论 -
Minimum Sum LCM UVA - 10791 (唯一分解定理+最小公倍数和其联系)
直击题目:https://vjudge.net/problem/19594/origin题目大意:有一个整数n,1题解:不是紫书上的提示自己也想不到这个结论,把n用唯一分解定理分解后得到n=a1^p1*a2^p2.......其中把每个分解出来的数当做一个数加起来就是最小的,sum=a1^p1+a2^p2.....,可以看到这几个数是互素的,他们的gcd是1,也就是不能再约分了原创 2017-03-24 15:23:20 · 526 阅读 · 0 评论 -
GCD XOR UVA - 12716 (gcd(),异或)
直击题目:https://vjudge.net/problem/49096/origin题目大意:输入整数n(1ps:紫书p318,这个题如果是在赛场上自己是真推导不出来,根本就想不到啊,惭愧。。。题解见紫书吧,自己的感悟就是弱。满足这样条件的会发现如果c=aXORb=gcd(a,b),那么b=a-c;而且c是a的约数,所以枚举a和c就行了,枚举的时候用类似于素数筛的方法#in原创 2017-03-24 16:59:43 · 802 阅读 · 0 评论 -
irrelevant Elements (组合数学)uva-1635
题目大意: 对于给定的n个数a1,a2,a3....an,一次求出相邻两个数之和,将得到一个新的数列。重复上述操作,最后结果将变成一个数。问这个数除以m的余数与那些数无关?例如n=3,m=2时,第一次求和结果a1+a2,a2+a3,在求和a1+2a2+a3,它除以2的余数和a2无关,1题解:(紫书p320)显然最后的求和式是a1,a2,a3....an的线性组合。设ai的系数为f(i原创 2017-03-29 10:15:18 · 783 阅读 · 1 评论 -
广工校赛2017 - Problem E: 倒水(Water) Problem C: 爬楼梯
广工校赛2017 - Problem E: 倒水(Water) Problem C: 爬楼梯原创 2017-03-29 10:42:11 · 524 阅读 · 0 评论 -
2016山东省第七届ACM省赛-部分题解
sdut-3560-julyed:http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Index/problemdetail/pid/3560.htmlJulyedProblem Description Julyed is preparing for her CET-6. She has N words to rememb原创 2017-04-11 10:35:15 · 2457 阅读 · 0 评论