上一页 1 ··· 6 7 8 9 10 11 下一页

2019年8月24日

POJ 1306 暴力求组合数

摘要: Combinations Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 11049 Accepted: 5013 Description Computing the exact number of ways that N thi 阅读全文

posted @ 2019-08-24 13:53 Caution_X 阅读(166) 评论(0) 推荐(0) 编辑

POJ 2249 暴力求组合数

摘要: Binomial Showdown Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22692 Accepted: 6925 Description In how many ways can you choose k elemen 阅读全文

posted @ 2019-08-24 13:30 Caution_X 阅读(131) 评论(0) 推荐(0) 编辑

UVA 10098 用字典序思想生成所有排列组合

摘要: 题目: Generating permutation has always been an important problem in computer science. In this problemyou will have to generate the permutation of a giv 阅读全文

posted @ 2019-08-24 12:55 Caution_X 阅读(161) 评论(0) 推荐(0) 编辑

POJ 1146 ID Codes 用字典序思想生成下一个排列组合

摘要: ID Codes Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 7644 Accepted: 4509 Description It is 2084 and the year of Big Brother has finally 阅读全文

posted @ 2019-08-24 11:09 Caution_X 阅读(197) 评论(0) 推荐(0) 编辑

2019年8月22日

FZU 1759 题解 欧拉降幂

摘要: 本题考点:欧拉降幂 Super A^B mod C Given A,B,C, You should quickly calculate the result of A^B mod C. (1<=A,C<=1000000000,1<=B<=10^1000000). Input There are mu 阅读全文

posted @ 2019-08-22 21:03 Caution_X 阅读(159) 评论(0) 推荐(0) 编辑

2019年8月21日

简谈欧拉函数

摘要: START 参考博客:https://blog.csdn.net/qq_39922639/article/details/77511761 欧拉函数是积性函数的一种,所谓积性函数是指满足,gcd(a,b)&&ƒ(a*b)=ƒ(a)*ƒ(b)的函数,特别的,若gcd(a,b)!=1但是ƒ(a*b)=ƒ 阅读全文

posted @ 2019-08-21 10:53 Caution_X 阅读(176) 评论(0) 推荐(0) 编辑

2019年8月20日

中国剩余定理详解

摘要: START 中国剩余定理用于求解线性同余方程组: a = a1 (mod n1) a = a2 (mod n2) a = a3 (mod n3) ........ a = ai (mod ni) 任意ni和nj(i != j)互质,问a的值。 我们可以把a写成a=Σai*ci,(ci待求),这个式子 阅读全文

posted @ 2019-08-20 22:09 Caution_X 阅读(517) 评论(0) 推荐(0) 编辑

大素数判定

摘要: START 判断一个数是不是素数可以直接暴力或者是素数筛。 但是对于一个特别大的数,直接用素数筛也有可能TLE。 这个时候就要想点别的办法: 1. 筛选法+试除法 首先用素数筛筛出[2,sqrt(n)+1]的素数,然后用这些素数来判断能不能整除n,如果可以,那么n一定是合数,如果都不行,那么n是素数 阅读全文

posted @ 2019-08-20 21:42 Caution_X 阅读(642) 评论(0) 推荐(0) 编辑

【模板】gcd和exgcd

摘要: 1. gcd: 1 int gcd(int a,int b) 2 { 3 return !b?a:gcd(b,a%b); 4 } exgcd: 1 int exgcd(int a,int b,int& x,int& y) 2 { 3 int d=a; 4 if(b){ 5 d=exgcd(b,a%b 阅读全文

posted @ 2019-08-20 20:41 Caution_X 阅读(137) 评论(0) 推荐(0) 编辑

素数筛(埃氏筛+欧拉筛)

摘要: 素数筛 顾名思义,用来筛选素数。 这里介绍两种素数筛: 1.埃氏筛(埃拉托斯特尼筛法) 1 void ass() 2 { 3 memset(u,true,sizeof(u));//u[i]=true表示i是素数 4 for(int i=2; i<=1100000; i++) 5 { 6 if(u[i 阅读全文

posted @ 2019-08-20 20:36 Caution_X 阅读(186) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 下一页

导航