
ACM_数论
文章平均质量分 73
HQD因为有趣所以做题
这个作者很懒,什么都没留下…
展开
-
1716: Divisors(素数筛选)
StatusIn/OutTIME LimitMEMORY LimitSubmit TimesSolved UsersJUDGE TYPEstdin/stdout3s8192K266100StandardMathematicians love all sorts of odd properties of num原创 2010-03-03 15:52:00 · 1202 阅读 · 0 评论 -
zoj 1222 Just the Facts
<br />Just the FactsTime Limit: 1 Second Memory Limit: 32768 KBThe expression N!, read as "N factorial," denotes the product of the first N positive integers, where N is nonnegative. So, for example,<br />N N! <br />0 1 <br />1 1 <br />2 2 <br /原创 2011-02-08 13:57:00 · 2012 阅读 · 1 评论 -
zoj 1850 Factovisors
<br /> FactovisorsTime Limit: 1 Second Memory Limit: 32768 KB<br />The factorial function, n! is defined thus for n a non-negative integer: <br /><br />0! = 1<br />n! = n * (n - 1)! (n > 0)<br />We say that a divides b if there exists an integer k s原创 2011-02-08 18:15:00 · 904 阅读 · 0 评论 -
2154 Color//POLYA
ColorTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 2967 Accepted: 1016<br />DescriptionBeads of N colors are connected together into a circular necklace of N beads (N<=1000000000). Your job is to calculate how many different kinds of the neckla原创 2011-02-13 09:41:00 · 713 阅读 · 0 评论 -
2773 Happy 2006 //欧拉函数的应用
Happy 2006Time Limit: 3000MS Memory Limit: 65536KTotal Submissions: 5258 Accepted: 1576<br />DescriptionTwo positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9...are all relati原创 2011-02-14 10:32:00 · 1004 阅读 · 0 评论 -
3270 Cow Sorting //利用置换排序
Cow SortingTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 3610 Accepted: 1196<br />Description<br />Farmer John's N (1 ≤ N ≤ 10,000) cows are lined up to be milked in the evening. Each cow has a unique "grumpiness" level in the range 1...100,000原创 2011-02-13 13:28:00 · 3091 阅读 · 1 评论 -
1026 Cipher //置换群
CipherTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 13690 Accepted: 3460<br />DescriptionBob and Alice started to use a brand-new encoding scheme. Surprisingly it is not a Public Key Cryptosystem, but their encoding and decoding is based on sec原创 2011-02-13 15:34:00 · 1395 阅读 · 0 评论 -
1286 Necklace of Beads
Necklace of BeadsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3389 Accepted: 1417<br />DescriptionBeads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 24 ). If the repetitions that are produced by原创 2011-02-13 10:27:00 · 856 阅读 · 0 评论 -
2478 Farey Sequence //欧拉函数
Farey SequenceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7076 Accepted: 2610<br />DescriptionThe Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rational numbers a/b with 0 < a < b <= n and gcd(a,b) = 1 arranged in原创 2011-02-13 17:28:00 · 691 阅读 · 0 评论 -
poj 2409 Let it Bead //poly
<br />Let it BeadTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2261 Accepted: 1406<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. T原创 2011-03-28 20:07:00 · 958 阅读 · 0 评论 -
NOI2010 能量采集
#include #include using namespace std;const int MAXN = 100000 + 123;long long cnt[MAXN];int main(){ long long n, m; cin >> n >原创 2011-08-01 14:21:18 · 1548 阅读 · 0 评论 -
hdu 1299
水题无奈数论还是比较水#include #include const int MAXN = 40000;bool isprim[MAXN];int prim[MAXN];int main(){ for(int i = 2; i < MAXN;原创 2011-07-30 20:00:10 · 931 阅读 · 0 评论 -
hdu-3637 Find a Fraction
从这个题目学到很多东西吧首先是处理输入吧,怎么可以比较方便的表示循环小数,标程写的十分好接着就是把左右端点表示成分数后,怎么找这个分数呢就是当两个端点跨越了整数时,取最小的整数,分母自然为1,这个是分子分母和最小的情况(至于为什么,动手比划一下原创 2011-07-31 11:09:21 · 1138 阅读 · 0 评论 -
poj 1150 The Last Non-zero Digit
<br />The Last Non-zero DigitTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3137 Accepted: 840<br />DescriptionIn this problem you will be given two decimal integer number N, M. You will have to find the last non-zero digit of the NPM.This m原创 2011-02-08 13:21:00 · 1301 阅读 · 0 评论 -
poj 2891 Strange Way to Express Integers 中国剩余定理
<br />Strange Way to Express IntegersTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 4191 Accepted: 1100<br />Description<br /> Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. Th原创 2011-02-07 15:46:00 · 2399 阅读 · 1 评论 -
POJ 2115 C Looooops
<br />C LooooopsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9301 Accepted: 2117<br />DescriptionA Compiler Mystery: We are given a C-language style for loop of type <br />for (variable = A; variable != B; variable += C)<br /> statement;<原创 2011-02-07 13:50:00 · 1348 阅读 · 0 评论 -
POJ 1061 青蛙的约会
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 50937 Accepted: 7474<br />Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青原创 2010-08-03 09:55:00 · 368 阅读 · 0 评论 -
2142 The Balance
The BalanceTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 1643 Accepted: 695<br />DescriptionMs. Iyo Kiffa-Australis has a balance and only two kinds of weights to measure a dose of medicine. For example, to measure 200mg of aspirin using 300mg原创 2010-08-03 11:35:00 · 771 阅读 · 0 评论 -
数学题目解题报告
<br /><br />对数学类题目小结中的题目的简单解题报告:<br /> <br /> 偶然在网上看到某牛人发的数学题目小结,于是拷了回来做,下面每道题目后面注释的是我写的简单解题报告(有些只是注意事项),而且并非所有都有做,所以希望大家理解,目前正在更新中。<br /> <br /> 原文连接在这里:http://hi.baidu.com/%B1%BF%D0%A1%BA%A2_shw/blog/item/5305e12c7289973e359bf768.html <br /> <br转载 2010-08-04 09:13:00 · 1312 阅读 · 0 评论 -
2891 Strange Way to Express Integers
<br /><br />Strange Way to Express IntegersTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 3301 Accepted: 810<br />Description<br /> Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integer原创 2010-08-04 09:59:00 · 710 阅读 · 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 · 790 阅读 · 0 评论 -
Problem 1607 Greedy division
<br /><br />Problem 1607 Greedy division Accept: 166 Submit: 760<br />Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description<br />Oaiei has inherited a large sum of wealth recently; this treasure has n pieces of golden coins. Unfortuna原创 2010-08-10 11:40:00 · 616 阅读 · 0 评论 -
算n因子的个数
<br /><br />这种题目以前就曾经做过,但是这次在做又忘了怎么写,在这里做个总结,任意一个数n都可以表示成p1^n1*p2^n2*p3^n3..........(p1,p2....是n的素因子,n1,n2是p1,p2的个数),n因子的个数就num=(n1+1)*(n2+1)*........<br /> 所以我们在算因子个数的时候,就要先筛素数,筛素数的方法有很多种,效率也都不一样,用不同的方面也影响着后面算n1,n2....同样也影响后来算num的效率<br />原创 2010-08-10 11:13:00 · 3558 阅读 · 1 评论 -
ZOJ 3286 Very Simple Counting
<br />Very Simple CountingTime Limit: 1 Second Memory Limit: 32768 KB <br />Let f(n) be the number of factors of integer n.<br />Your task is to count the number of i(1 <= i < n) that makes f(i) = f(n).<br />Input<br />One n per line (1 < n <= 100原创 2010-08-10 14:19:00 · 818 阅读 · 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 · 820 阅读 · 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 · 584 阅读 · 0 评论 -
poj 1061 青蛙的约会
<br /><br />有些数学题都忘了怎么做了,重新做!青蛙的约会Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 56311 Accepted: 8537<br />Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,原创 2011-02-04 20:58:00 · 554 阅读 · 0 评论 -
zoj 2657 Appointment 扩展欧几里得
<br /> AppointmentTime Limit: 1 Second Memory Limit: 32768 KB <br />Two crickets gets know with each other on freecity bbs. They feel very happy chatting with each other, so they want to meet the other. Fortunately, they find they both live the原创 2011-02-07 11:22:00 · 1115 阅读 · 0 评论 -
poj 1222 EXTENDED LIGHTS OUT //高斯消元
整理一下这块而已#include#include#include#include#includeusing namespace std;#define MAX_VAR 110 //geshu#define MAX_EQU 110 //位数#define M原创 2011-09-06 19:49:53 · 1202 阅读 · 0 评论