- 博客(17)
- 资源 (1)
- 收藏
- 关注
原创 约瑟夫环
//41个人围成环,数到3的自杀,下一个人重新开始数求最终剩下的人#include#include#define N 41//总人数 #define M 3//数到3出列 int main(){int man[N]={0};//保存出列的序号,为0的出列int count=1;//出列计数器int i=0;//报数计数器int pos=-1;//位置计数器 int alive=
2016-09-25 14:11:48 301
原创 汉诺塔
n个圆盘--移动次数2^n-1;#includelong count;//记录移动次数void hanoi(int n,char a,char b,char c)//要将n个从a移到c上,b作为辅助的柱 {if(n==1)printf("第%d次,%c-->%c柱\n",++count,a,c);else{ hanoi(n-1,a,c,b);//先将n-1个移到辅助柱上 p
2016-09-23 22:39:19 195
原创 **并查集
Find them, Catch themTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionThe police office in Tadu City decides to say ends to the c
2016-09-23 22:09:43 236
原创 **回文串
Generating PalindromesTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionBy definition palindrome is a string which is not changed when
2016-09-23 16:13:20 332
原创 学生信息管理系统--Sqlist-顺序表
#include#include#include#include#define OK 1#define ERROR 0#define OVERFLOW -2typedef int Status; //Status 是函数返回值类型,其值是函数结果状态代码。#define MAXSIZE 100 //顺序表可能达到的最大长度typedef struct{ char no[8
2016-09-21 21:48:09 5043
原创 codeforce285A--Misha and Changing Handles-字符串
Misha and Changing HandlesTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionMisha hacked the Codeforces site. Then he decided t
2016-09-21 18:04:34 347
原创 codeforce218A-- Contest(水)
D - ContestTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionMisha and Vasya participated in a Codeforces contest. Unfortunately,
2016-09-21 16:34:23 291
转载 计算机几何常用算法
1、矢量减法设二维矢量 P = (x1,y1) ,Q = (x2,y2)则矢量减法定义为: P - Q = ( x1 - x2 , y1 - y2 )显然有性质 P - Q = - ( Q - P )如不加说明,下面所有的点都看作矢量,两点的减法就是矢量相减;2、矢量叉积设矢量P = (x1,y1) ,Q = (x2,y2)则矢量叉积定义为: P × Q =
2016-09-20 18:17:51 1951
原创 codefoce500B
New Year PermutationTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionUser ainta has a permutation p1, p2, ..., pn. As the New
2016-09-20 18:12:16 352
原创 codefoceA--New Year Transportation
New Year TransportationTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionNew Year is coming in Line World! In this world, there
2016-09-20 18:02:28 370
原创 求中位数
Optimal Point on a LineTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit Status Practice _Appoint description: System Crawler (Sep 16, 2016 7:22:55 PM)
2016-09-16 20:00:31 485
原创 *哥德巴赫猜想
猜想:任何一个大于2的偶数都可以写成两个质数之和数值验证:#include#include#includeint f(int n,int prime[]){ int i,j; for(i=2;i<=n;i++) prime[i]=1; prime[0]=prime[1]=0; for(i=2;i*i<=n;i++) { if(prime[i]==1) {
2016-09-14 17:50:22 699
原创 RSA算法基础
RSA定理:若P,Q是两个相异质数,另有正整数R,M;其中M的值与(P-1)*(Q-1)互质,并使得(RM)mod(P-1)(Q-1)=1.有正整数A,且A C=A的R次方 mod PQ; B=C的M次方 mod PQ;则有A==B;生成公钥和私钥:1.选择素数P,Q2.N=P*Q3
2016-09-14 16:11:25 333
原创 求解孪生素数--梅森素数
孪生素数:间隔为2的相邻素数#include#includeint main(){ //素数打表 int a[10001]={1,1}; for(int i=2;i<=10000;i++) { if(a[i]==1) continue; for(int j=2*i;j<=10000;j+=i) a[j]=1; } //统计素数数量 int c=0;i
2016-09-14 16:04:10 625
原创 codeforces710A--King Moves水
D - King MovesTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit Status Practice CodeForces 710AAppoint description: System Crawler (Sep 10, 2016 3:46
2016-09-10 17:46:57 217
原创 codeforce708A-Letters Cyclic Shift
Letters Cyclic ShiftTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit Status Practice CodeForces 708AAppoint description: System Crawler (Sep 9, 2016
2016-09-10 16:53:26 328
原创 A+B for Matrices
题目1001:A+B for Matrices时间限制:1 秒内存限制:32 兆特殊判题:否提交:19925解决:7958题目描述: This time, you are supposed to find A+B where A and B are two matrices, and then count the num
2016-09-02 17:18:50 362
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人