自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Orz

  • 博客(44)
  • 收藏
  • 关注

原创 2017年11月26日训练笔记

昨天数论20点关闭,我一直没看进度条还以为还是今天晚上关,所以做的少了一点,心里还是怪不舒服,今天看了看数论的书,看了几个博客和题目,上个数论的总结也有更新。这里也另外补充一些。这组专题应用比较多的有:快速幂,解线性同余方程,分解定理。解线性同余方程,即不互质的中国剩余定理,这个知识点看了很久才明白些,应用还是比较多的,       题目:hdu - 1788 - Ch

2017-11-26 22:23:33 303

转载 HDU - 1452 - Happy 2004 - (因子和,极性函数,同余逆元)

转自:http://www.cnblogs.com/372465774y/archive/2012/10/22/2733977.htmlHappy 2004Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 673    Ac

2017-11-26 17:28:08 232

原创 HDU - 1573 - X问题 - (解线性同余方程)

求在小于等于N的正整数中有多少个X满足:X mod a[0] = b[0], X mod a[1] = b[1], X mod a[2] = b[2], …, X mod a[i] = b[i], … (0 < a[i] <= 10)。Input输入数据的第一行为一个正整数T,表示有T组测试数据。每组测试数据的第一行为两个正整数N,M (0 < N <= 1000,000,000 , 0 < M <= 10),表示X小于等于N,数组a和b中各有M个元素。接下来两行,每行各有M个正整数,分别为a和b中的元

2017-11-25 22:19:44 269

原创 POJ - 1845 - Sumdiv-(数论,唯一分解定理,约数和公式,用递归二分求等比数列,快速幂)

Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901).InputThe only line contains the two natural

2017-11-25 20:16:54 223

转载 数学公式

转自:http://blog.csdn.net/hanhai768/article/details/38018991(1)   整数的唯一分解定理:      任意正整数都有且只有一种方式写出其素因子的乘积表达式。      A=(p1^k1)*(p2^k2)*(p3^k3)*....*(pn^kn)   其中pi均为素数(2)   约数和公式:

2017-11-25 20:15:07 267

原创 hdu - 3123 - GCC - (阶乘求余)

The GNU Compiler Collection (usually shortened to GCC) is a compiler system produced by the GNU Project supporting various programming languages. But it doesn’t contains the math operator “!”. In ma

2017-11-25 13:58:35 226

原创 CodeForces - 251A - Points on Line

Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distance be

2017-11-24 00:25:11 296

原创 POJ - 1995 - Raising Modulo Numbers - (快速幂)

People are different. Some secretly read magazines full of interesting girls' pictures, others create an A-bomb in their cellar, others like using Windows, and some like difficult mathematical games.

2017-11-24 00:19:17 181

原创 2017年11月23日训练笔记

借了几本数论的书,之前确实没想到去借几本书看看,确实系统的看看这些知识点整体的把握一下会好很多,随着天气越来越冷,实验室空调也开足了,哈哈哈,实验室很暖和的,有更多的理由去实验室了。。。       数论内容能学好,比赛上应该也是有区分度的一种题型,数论嘛,学起来是需要深入理解的内容,与解数学题一样,要掌握的是分析问题的思路和方法。

2017-11-23 22:54:00 171

原创 poj - 1730 - Perfect Pth Powers - (分解质因数)

We say that x is a perfect square if, for some integer b, x = b 2. Similarly, x is a perfect cube if, for some integer b, x = b 3. More generally, x is a perfect pth power if, for some integer b, x =

2017-11-23 12:33:06 381

原创 hdu - 2973 - YAPTCHA - (威尔逊定理)

The math department has been having problems lately. Due to immense amount of unsolicited automated programs which were crawling across their pages, they decided to put Yet-Another-Public-Turing-Test-

2017-11-23 10:45:26 322

原创 CodeForces - 253B - Physics Practical

One day Vasya was on a physics practical, performing the task on measuring the capacitance. He followed the teacher's advice and did as much as n measurements, and recorded the results in the notebook

2017-11-22 23:16:59 401

原创 hdu - 3579 - Hello Kiki - (不互质的中国剩余定理)

One day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and singing "门前大桥下游过一群鸭,快来快来 数一数,二四六七八". And then the cashier put the counted coins ba

2017-11-19 22:15:02 379

原创 2017年11月19日训练笔记

今天做的几个数论题还不算多难,随着题目做的多了确实感觉好了很多,至少算法使用起来熟练很多,随着这学期逐渐推进,课程也越来越少了,现在就是做题吧,今晚的cf就先不打了,争取能将知识点理解的更透彻,题目这次也要多做些。

2017-11-19 21:06:54 159

原创 hdu - 2588 - GCD(欧拉函数求同值gcd个数)

 The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b,For example,(1,2)=1,(12,18)=6. (a,b) can be easily found by t...

2017-11-19 20:34:03 366

原创 hdu - 1788 - Chinese remainder theorem again-(gcd,不互质的中国剩余定理)

我知道部分同学最近在看中国剩余定理,就这个定理本身,还是比较简单的: 假设m1,m2,…,mk两两互素,则下面同余方程组: x≡a1(mod m1) x≡a2(mod m2) … x≡ak(mod mk) 在0记Mi=M/mi(1ei≡0(mod mj),j!=i ei≡1(mod mj),j=i 很显然,e1a1+e2a2+…+ekak就是方程组的一个解,

2017-11-19 19:34:14 340

原创 hdu - 3501 - Calculation 2-(欧拉函数求互质数的和)

 Given a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A is said to be coprime to B if A, B share no common positive divisors...

2017-11-19 17:00:43 445

原创 Poj - 3641 - Pseudoprime numbers-(快速幂)

Fermat's theorem states that for any prime number p and for any integer a > 1, ap = a (mod p). That is, if we raise a to the pth power and divide by p, the remainder is a. Some (but not very many) n

2017-11-18 23:41:11 236

原创 POJ - 1320 - Street Numbers - (佩尔方程)

A computer programmer lives in a street with houses numbered consecutively (from 1) down one side of the street. Every evening she walks her dog by leaving her house and randomly turning left or right

2017-11-17 00:26:09 331

原创 2017年11月16日训练笔记

最近有点凌乱,这个周六有英语口语考试,今天大概准备了一下,周日有选修课考试,再过一星期就是数据库考试,好几百页的书。。。然后就是英语四级,我一套题都没做完。。。       得合理分配一下时间了,然后就是数论2专题,真是不好意思说,那些数学定理证明理解起来实在是太抽象,一个证明看个几遍只是眼熟,所以有的定理我还是只会模板,现在感觉数论是一群山,还需要一座一座去攀爬。但这次的数论会努力提前做的。

2017-11-16 22:57:59 179

原创 CodeForces - 248B - Chilly Willy - (规律)

Chilly Willy loves playing with numbers. He only knows prime numbers that are digits yet. These numbers are 2, 3, 5 and 7. But Willy grew rather bored of such numbers, so he came up with a few games

2017-11-15 23:34:45 307

原创 CodeForces - 250C - Movie Critics - (模拟)

A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre — an integer from 1 to k.On the

2017-11-15 23:09:55 240

原创 poj - 1284 - Primitive Roots - (欧拉函数求原根)

 We say that integer x, 0 &lt; x &lt; p, is a primitive root modulo odd prime p if and only if the set { (x i mod p) | 1 &lt;= i &lt;= p-1 } is equal to { 1, ..., p-1 }. For example, the consecutive...

2017-11-15 12:52:37 278

原创 2017年11月12题训练日记

       发现博客10点以后提交不上,数论一会就结束 了,下面说一下部分知识点:快速幂: int pow_mod(int n,int k,int m) //快速幂求n^k余m的结果{ int res=1; n=n%mod; while(k&gt;0) { if(k&amp;1) res...

2017-11-12 21:26:01 291

原创 (进制转化)

A few days earlier a certain mathematician had been fired from his job so he has made up his mind to take revenge on his former employers and has changed all the numbers in their databases to their co

2017-11-12 21:02:18 196

原创 UVa - 10717 - Mint-(4个数的最大公约数)

The Royal Canadian Mint has commissioned a new series of designer coffee tables, with legs that are constructed from stacks of coins. Each table has four legs, each of which uses a different type of

2017-11-12 20:03:24 231

原创 UVa - 10692 - Huge Mods-(幂的模)

代码:#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;#define M 1005char str[25];int n,m,ans;int a[25];int pow_mod(int

2017-11-12 17:23:42 236

原创 UVa - 10912 - Simple Minded Hashing-(dp)

All of you know a bit or two about hashing. It involves mapping an element into a numerical value using some mathematical function. In this problem we will consider a very ‘simple minded hashing’. It

2017-11-12 12:00:30 292

原创 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 th

2017-11-11 21:59:25 191

原创 UVa - 10616 - Divisible Group Sums(dp)

Given a list of N numbers you will be allowed to choose any M of them. So you can choose in NCM ways. You will have to determine how many of these chosen groups have a sum, which is divisible by D.

2017-11-11 20:42:11 234

原创 UVa - 571 - Jugs -(倒水问题)

参考:https://www.cnblogs.com/devymex/archive/2010/08/04/1792288.htmlTime limit: 3.000 seconds BackgroundIn the movie "Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted with

2017-11-11 17:44:06 249

原创 uva-10299-Relatives-(欧拉函数)

 Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x &gt; 1, y &gt; 0, z &gt; 0 such t...

2017-11-11 17:30:02 335

原创 Codeforces-Educational Codeforces Round 32-(A,B,C,D)

今天这场竟然A了4道题,哈哈哈哈,开心而且有一道题是最后一分钟AC。。。先贴代码A. Local Extrematime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstanda

2017-11-10 01:07:02 740

原创 2017年11月9日训练笔记

今天做题不多,就做了2,3个,本以为能多做点,就是今天遇到这个中国剩余定理,之前看资料就看了好几遍都不是很明白,今天做到中国剩余定理的题目虽然题目简单,但是还是去看了很多博客,花了很久才明白了点,让我自己总结也是总结不出来。      然后今晚有场cf,倒时候也可以打一打,不想打了就还是做题。明天和周末要加把劲了,争取做更多的题目。

2017-11-09 22:02:37 226

原创 Uva-10162-Last Digit-(快速幂,规律)

代码:#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;#define M 105int len;char str[110];int ans[M];int powmod(int n,int

2017-11-09 21:40:50 182

转载 中国剩余定理(详解)

中国剩余定理中国剩余定理可以描述为:若某数x分别被d1、、…、dn除得的余数为r1、r2、…、rn,则可表示为下式:x=R1r1+R2r2+…+Rnrn+RD其中R1是d2、d3、…、dn的公倍数,而且被d1除,余数为1;(称为R1相对于d1的数论倒数)R1 、R2 、…  、Rn是d1、d2、…、dn-1的公倍数,而且被dn除,余数为1;D

2017-11-09 20:27:19 2638

原创 poj-1006-Biorhythms-(中国剩余定理)

DescriptionSome people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical, emotional, and intellectual cycles, and the

2017-11-09 20:14:44 292

原创 UVa-10139 Factovisors -(阶乘的整除)

计算数 m 和数 2 ~n 的 GCD,若 GCD > 1,则 m /= GCD,若最后 m 不为 1 则表明 m 不能整除 n!,代码:#include#include#include#include#include#include#include#include#includeusing namespace std;#define M 1000005typed

2017-11-09 09:57:03 311

原创 uva 10994 - Simple Addition

#include#include#include#include#include#include#include#include#includeusing namespace std;#define M 1000005typedef long long ll;int p,q;ll ans;ll f(ll n){ if(n==0) retur

2017-11-06 23:20:43 263

原创 UVA 10539 Almost Prime Numbers( 素数因子)

Almost prime numbers are the non-prime numbers which are divisible by only a single prime number. In this problem your job is to write a program which finds out the number of almost prime numbers with

2017-11-06 23:13:21 266

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除