
数论
lyhvoyage
不抛弃,不放弃!
展开
-
NYOJ 题目528 找球号(三)
找球号(三)时间限制:2000 ms | 内存限制:3000 KB难度:2描述xiaod现在正在某个球场负责网球的管理工作。为了方便管理,他把每个球都编了号,且每个编号的球的总个数都是偶数。有一天,xiaod发现少了一个球,你能帮他找出丢的那个球的球号吗?输入有多组测试数据。每组数据包括两行。第一行是一个整数N(0随后的一行是N个数,原创 2013-05-19 18:07:41 · 1334 阅读 · 0 评论 -
NYOJ 1066 CO-PRIME(数论)
CO-PRIME时间限制:1000 ms | 内存限制:65535 KB难度:3描述This problem is so easy! Can you solve it?You are given a sequence which contains n integers a1,a2……an, your task is to find how man原创 2014-08-09 17:04:22 · 1789 阅读 · 3 评论 -
hdu 4937 Lucky Number(数学题 进制转换)2014多校训练第7场
Lucky Number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Problem Description原创 2014-08-13 10:05:46 · 1859 阅读 · 0 评论 -
CodeForces 321A Ciel and Robot(数学模拟)
题目链接:http://codeforces.com/problemset/problem/321/A题意:在一个二维平面中,开始时在(0,0)点,目标点是(a,b),问能不能通过重复操作题目中的指令,从原点移动到目标点。分析:假设一次完成所有的命令后,移动到了(xx,yy),并且从(Xi,Yi)重复操作k次指令到达目标点,则可以列出方程 Xi + k * xx = a && Yi + k原创 2014-10-08 20:01:32 · 1380 阅读 · 0 评论 -
NYOJ 928 小M的因子和(数论)
小M的因子和时间限制:1000 ms | 内存限制:65535 KB难度:2描述小M在上课时有些得意忘形,老师想出道题目难住他。小M听说是求因子和,还是非常得意,但是看完题目是求A的B次方的因子和,有些手足无措了,你能解决这个问题吗?输入有多组测试样例每行两个数 A ,B ,(1≤A,B≤10^9) 输出输出A的B次方的因子和,并对9901取余。样例输入2原创 2014-10-09 19:14:43 · 1660 阅读 · 0 评论 -
NYOJ 762 第k个互质数(二分 + 容斥)
第k个互质数时间限制:1000 ms | 内存限制:65535 KB难度:4描述两个数的a,b的gcd为1,即a,b互质,现在给你一个数m,你知道与它互质的第k个数是多少吗?与m互质的数按照升序排列。输入输入m ,k (1输出输出第k个数。样例输入10 110 210 3样例输出137首先,根据欧几里得可知,gcd原创 2014-11-12 17:24:58 · 1960 阅读 · 0 评论 -
zoj 3696 Alien's Organ(泊松分布)
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3696Alien's OrganTime Limit: 2 Seconds Memory Limit: 65536 KBThere's an alien whose name is Marjar. It is an univer原创 2014-11-17 09:07:54 · 1936 阅读 · 0 评论 -
POJ 1026 Cipher(置换)
CipherTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 19502 Accepted: 5239DescriptionBob and Alice started to use a brand-new encoding scheme.原创 2014-10-15 15:06:17 · 1940 阅读 · 0 评论 -
UVA 10910 Marks Distribution(组合数学 或 递推)
Marks DistributionTime limit: 3.000 secondsIn an examination one student appeared in N subjects and has got total T marks. He has passed in all the Nsubjects where minimum mark for passing i原创 2014-10-13 18:34:38 · 1466 阅读 · 0 评论 -
POJ 1061 青蛙的约会(扩展欧几里得)
青蛙的约会Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 91753 Accepted: 16849Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西原创 2014-10-17 19:18:47 · 2842 阅读 · 1 评论 -
poj 1730Perfect Pth Powers(分解质因数)
Perfect Pth PowersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 16746 Accepted: 3799DescriptionWe say that x is a perfect square if, for some inte原创 2014-10-18 12:26:32 · 2262 阅读 · 0 评论 -
UVA 10892 LCM Cardinality(数论 质因数分解)
LCM CardinalityInput: Standard InputOutput: Standard OutputTime Limit: 2 Seconds A pair of numbers has a unique LCM but a single number can be the LCM of more than one possible pairs. For ex原创 2014-10-17 14:21:44 · 1867 阅读 · 0 评论 -
UVA 568 - Just the Facts(数论)
Just the FactsThe expression N!, read as ``N factorial," denotes the product of the first N positive integers, where N is nonnegative. So, for example,NN!0111原创 2013-07-12 10:23:43 · 3007 阅读 · 1 评论 -
CodeForce 424C Magic Formulas(数学题)
Magic Formulastime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPeople in the Tomskaya region like magic for原创 2014-07-21 10:17:17 · 1382 阅读 · 0 评论 -
UVA 10090 Marbles(扩展欧几里得)
MarblesInput: standard inputOutput: standard outputI have some (say, n) marbles (small glass balls) and I am going to buy some boxes to store them. The boxes are of two types:Type 1: each原创 2014-07-18 17:04:57 · 2153 阅读 · 2 评论 -
NYOJ 84 阶乘的0 数论
阶乘的0时间限制:3000 ms | 内存限制:65535 KB难度:3描述计算n!的十进制表示最后有多少个0输入第一行输入一个整数N表示测试数据的组数(1每组测试数据占一行,都只有一个整数M(0输出输出M的阶乘的十进制表示中最后0的个数比如5!=120则最后的0的个数为1样例输入6360100102423456原创 2013-06-01 08:54:13 · 1668 阅读 · 0 评论 -
UVA 10006 - Carmichael Numbers 数论(快速幂取模 + 筛法求素数)
Carmichael Numbers An important topic nowadays in computer science is cryptography. Some people even think that cryptography is the only important field in computer science, and that life原创 2013-08-03 15:13:42 · 2964 阅读 · 0 评论 -
UVA 10820 - Send a Table 数论 (欧拉函数)
Send a TableInput: Standard InputOutput: Standard Output When participating in programming contests, you sometimes face the following problem: You know how to calcutale the output for the give原创 2013-08-03 18:26:49 · 2142 阅读 · 0 评论 -
hdu 1042 N! 高精度运算
N! Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionGive原创 2013-08-07 11:27:49 · 2029 阅读 · 0 评论 -
POJ 3292 Semi-prime H-numbers (数论)
Semi-prime H-numbersTime Limit: 1000MS Memory Limit: 65536K DescriptionThis problem is based on an exercise of David Hilbert, who pedagogically suggested that o原创 2014-01-17 19:24:25 · 2003 阅读 · 0 评论 -
NYOJ 982 Triangle Counting (数学题)
Triangle Counting时间限制:1000 ms | 内存限制:65535 KB描述You are given n rods of length 1, 2…, n. You have to pick any 3 of them and build a triangle. How many distinct triangles can you make? N原创 2014-03-21 09:10:47 · 1765 阅读 · 0 评论 -
hdu 3232 Crossing Rivers (数学期望)
Crossing Rivers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem原创 2014-04-02 19:34:55 · 2019 阅读 · 0 评论 -
NYOJ 301 递推求值(矩阵快速幂)
递推求值时间限制:1000 ms | 内存限制:65535 KB难度:4描述给你一个递推公式:f(x)=a*f(x-2)+b*f(x-1)+c并给你f(1),f(2)的值,请求出f(n)的值,由于f(n)的值可能过大,求出f(n)对1000007取模后的值。注意:-1对3取模后等于2输入第一行是一个整数T,表示测试数据原创 2014-04-04 12:25:44 · 3881 阅读 · 6 评论 -
hdu 4556 Stern-Brocot Tree
Stern-Brocot Tree Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Problem Descri原创 2014-04-03 19:05:28 · 1845 阅读 · 0 评论 -
hdu 4549 M斐波那契数列(费马小定理 + 二分快速幂 + 矩阵快速幂)
M斐波那契数列 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Problem DescriptionM斐波原创 2014-04-03 21:42:29 · 3283 阅读 · 0 评论 -
欧拉函数和最大公约数的组合应用
应用1Sum时间限制:1000 ms | 内存限制:65535 KB难度:3描述 给你一个数N,使得在1~N之间能够找到x使得x满足gcd( x , N ) >= M,求解gcd(x,N)的和输入多组测试数据每行输出两个数N,M(N,M不超int)输出输出sum样例输入5 3原创 2014-04-28 16:28:25 · 1304 阅读 · 0 评论 -
HDU 5212 Code(容斥 或 莫比乌斯反演)
CodeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionWLD likes playing with codes.One day he is writing a function.Howerver,his c原创 2015-04-27 09:49:25 · 2838 阅读 · 1 评论