09 2020 档案

摘要:1 #include <iostream> 2 #include <string> 3 #include <stdio.h> 4 #include <cmath> 5 #include <algorithm> 6 using namespace std; 7 8 bool judge(string 阅读全文
posted @ 2020-09-30 12:43 然终酒肆 阅读(272) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/msymm/articles/9917089.html 阅读全文
posted @ 2020-09-30 11:13 然终酒肆 阅读(90) 评论(0) 推荐(0) 编辑
摘要:1 #include <cstdio> 2 #include <set> 3 #include <iostream> 4 #include <cstring> 5 using namespace std; 6 7 8 9 int main() 10 { 11 int n, i, cnt = 0;in 阅读全文
posted @ 2020-09-30 10:29 然终酒肆 阅读(255) 评论(0) 推荐(0) 编辑
摘要:Description给定一个n*n的棋盘,棋盘中有一些位置不能放皇后。现在要向棋盘中放入n个黑皇后和n个白皇后,使任意的两个黑皇后都不在同一行、同一列或同一条对角线上,任意的两个白皇后都不在同一行、同一列或同一条对角线上。问总共有多少种放法?n小于等于8。Input输入描述:输入的第一行为一个整数 阅读全文
posted @ 2020-09-30 09:40 然终酒肆 阅读(107) 评论(0) 推荐(0) 编辑
摘要:西洋棋中的皇后可以直线前进,吃掉遇到的所有棋子,如果棋盘上有八个皇后, 则这八个皇后如何相安无事的放置在棋盘上 解法 关于棋盘的问题,都可以用递归求解, 然而如何减少递归的次数?在八个皇后的问题中, 不必要所有的格子都检查过,例如若某列检查过,该该列的其它格子就不用再检查了,这个方法称为分支修剪。 阅读全文
posted @ 2020-09-28 23:39 然终酒肆 阅读(125) 评论(0) 推荐(0) 编辑
摘要:1 /** 2 * C: Dijkstra算法获取最短路径(邻接矩阵) 3 * 6 */ 7 8 #include <stdio.h> 9 #include <stdlib.h> 10 #include <malloc.h> 11 #include <string.h> 12 13 #define 阅读全文
posted @ 2020-09-27 11:59 然终酒肆 阅读(400) 评论(0) 推荐(0) 编辑
摘要:如果我每一步迈上1个或两个台阶,先迈左脚,然后左右交换,最后一步迈右脚,也就是一共要走偶数步, 那么,上完39级台阶,有多少种不同的算法 1 #include "stdio.h" 2 int total=0;//计数 3 int Sum(int num,int step) 4 { 5 if(num< 阅读全文
posted @ 2020-09-26 16:21 然终酒肆 阅读(135) 评论(0) 推荐(0) 编辑
摘要:其实用现成的c++ 库中的sort排序就可以完美解决 但是为了体会算法的本质 我还要敲一遍别的 问题描述 给定一个长度为n的数列,将这个数列按从小到大的顺序排列。 1<=n<=200 输入格式 第一行为一个整数n。 第二行包含n个整数,为待排序的数,每个整数的绝对值小于 10000。 输出格式 输出 阅读全文
posted @ 2020-09-26 15:45 然终酒肆 阅读(357) 评论(0) 推荐(0) 编辑
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 int visit(int, int); 4 5 int maze[7][7] = 6 7 { 8 {2, 2, 2, 2, 2, 2, 2}, 9 {2, 0, 0, 0, 0, 0, 2}, 10 {2, 阅读全文
posted @ 2020-09-26 15:10 然终酒肆 阅读(318) 评论(0) 推荐(0) 编辑
摘要:1 #include "stdio.h" 2 #include "String.h" 3 #define MAX 10000 4 int f[MAX]; 5 void Arr_reset(int a[],int m,int n) 6 { 7 int i; 8 for(i=m;i<=m;i++) 9 阅读全文
posted @ 2020-09-26 14:53 然终酒肆 阅读(411) 评论(0) 推荐(0) 编辑
摘要:1.问题描述 1221是一个非常特殊的数,它从左边读和从右边读是一样的,编程求所有这样的四位十进制数。 输出格式 按从小到大的顺序输出满足条件的四位十进制数。 血马简单 但是还是要敲 1 #include"stdio.h" 2 int main(void) 3 { 4 int i,a,b,c,d; 阅读全文
posted @ 2020-09-26 14:26 然终酒肆 阅读(192) 评论(0) 推荐(0) 编辑
摘要:简单说来 set(集合)里的元素 不会有相同元素(也就是说 相同的值不存 )并且 存进去会自动排序 类比sort默认排序从小到大 set排序也是 set/multiset会根据待定的排序准则,自动将元素排序。两者不同在于前者不允许元素重复(重复元素只操作一遍,其他的忽略处理),而后者允许。(因为插入 阅读全文
posted @ 2020-09-24 23:32 然终酒肆 阅读(1273) 评论(0) 推荐(0) 编辑
摘要:1 #include <stdio.h> 2 #define N 12 //会输出 13 行 更改会输出相应的 N+1 行 3 long combi(int n, int r) 4 { 5 int i; 6 long p = 1; 7 for(i = 1; i <= r; i++) 8 p = p 阅读全文
posted @ 2020-09-24 17:49 然终酒肆 阅读(218) 评论(0) 推荐(0) 编辑
摘要:1 #include "stdio.h" 2 #include "math.h" 3 int main(void) 4 { 5 double y; 6 int x,m; 7 for(y=10;y>=-10;y--) 8 { 9 m=2.5*sqrt(100-y*y); 10 for(x=1;x<30 阅读全文
posted @ 2020-09-24 13:35 然终酒肆 阅读(250) 评论(0) 推荐(0) 编辑
摘要:输入: 请输入数时用空格隔开输入你要判断是否是回文的个数: 1 5 9 9 5 1 输出: 您输入的是回文 1 #include"stdio.h" 2 #define N 6 //通过更改 N 的值,可以改变输入的数的个数 3 //本题思想用数组的第一位与最后一位相比,然后依次第二与倒数第二。。。。 阅读全文
posted @ 2020-09-23 23:21 然终酒肆 阅读(359) 评论(0) 推荐(0) 编辑
摘要:1 #include"stdio.h" 2 #include"stdlib.h" 3 int main(void) 4 { 5 int n,a1,count=0,j;//count 用于角标的计数,j 控制 for 循环 6 int a[100]; 7 printf("Enter n:"); 8 s 阅读全文
posted @ 2020-09-23 23:12 然终酒肆 阅读(538) 评论(0) 推荐(0) 编辑
摘要:#include "stdio.h" #define N 50 long fun(char *s) { int i,t; long sum=0; for(i=0;s[i];i++) { if(s[i]>='0'&&s[i]<='9')//当字符是'0'--'9'时,*-‘0'就行了 t=s[i]-' 阅读全文
posted @ 2020-09-20 21:45 然终酒肆 阅读(376) 评论(0) 推荐(0) 编辑
摘要:1949年的国庆节(10月1日)是星期六。今年(2012)的国庆节是星期一。 那么,从建国到现在,有几次国庆节正好是星期日呢? 1 # include <stdio.h> 2 int yday(int year); 3 int main(void) 4 { 5 int year; 6 int n; 阅读全文
posted @ 2020-09-20 21:10 然终酒肆 阅读(159) 评论(0) 推荐(0) 编辑
摘要:#include<stdio.h> #include<stdlib.h> #define MAXINE 100 int main(void) { int j,i; int n; int a[MAXINE][MAXINE]; printf("Enter n:"); scanf("%d",&n); a[ 阅读全文
posted @ 2020-09-20 15:58 然终酒肆 阅读(111) 评论(0) 推荐(0) 编辑
摘要:ABCDEFG BABCDEF CBABCDE DCBABCD EDCBABC 这是一个5行7列的图形,请找出这个图形的规律,并输出一个n行m列的图形。 #include<stdio.h> #include<stdlib.h> #define MAXINE 26 void print(char a[ 阅读全文
posted @ 2020-09-20 15:47 然终酒肆 阅读(170) 评论(0) 推荐(0) 编辑
摘要:对于长度为5位的一个01 串,每一位都可能是0或1,一共有32种可能。它们的前几个是: 00000 00001 00010 00011 00100 请按从小到大的顺序输出这 32种01串。 1 #include<stdio.h> 2 int main(void) 3 { 4 int count=0; 阅读全文
posted @ 2020-09-20 14:40 然终酒肆 阅读(267) 评论(0) 推荐(0) 编辑
摘要:问题描述 给定圆的半径r,求圆的面积。 输入格式 输入包含一个整数r,表示圆的半径。 输出格式输出一行,包含一个实数,四舍五入保留小数点后7位,表示圆的面积。 样例输入 4 样例输出 50.2654825 1 #include<stdio.h> 2 #define PI 3.141592653589 阅读全文
posted @ 2020-09-20 14:31 然终酒肆 阅读(182) 评论(0) 推荐(0) 编辑
摘要:是很简单 我也得敲啊 啤酒每罐2.3元,饮料每罐1.9元。小明买了若干啤酒和饮料,一共花了 82.3元。 我们还知道他买的啤酒比饮料的数量少,请你计算他买了几罐啤酒。 注意:答案是一个整数 1 int main(int argc, char** argv) { 2 for(int i=1;i*2.3 阅读全文
posted @ 2020-09-20 14:22 然终酒肆 阅读(196) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 #include<stdio.h> 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 int 阅读全文
posted @ 2020-09-19 20:59 然终酒肆 阅读(76) 评论(0) 推荐(0) 编辑
摘要:要手动敲这些代码 为了再更加清晰理解算法本质 我尽量用最基本的c语言去敲 而不取用现成的库函数 阅读全文
posted @ 2020-09-19 20:52 然终酒肆 阅读(86) 评论(0) 推荐(0) 编辑
摘要:1.整数模 n 乘法群:在同余理论中,模 n 的互质同余类成一个乘法群,称为整数模 n 乘法群。2.循环群:设(G,*)为一个群,若存在一G内的元素g,对属于G的任意x,都存在整数k,使x = g^k ,称(G,*)为循环群,g为群的生成元。若存在最小正整数n,使得g^n=e,称n为生成元的阶(e为 阅读全文
posted @ 2020-09-15 18:25 然终酒肆 阅读(5087) 评论(0) 推荐(0) 编辑
摘要:我们先来简短认识一下Paillier同态加密算法: 如果就这么按照定义来用最简朴的c++程序写 就像这样: #include <iostream> #include <math.h> #include <stdlib.h> #include <time.h> #include<cmath> #def 阅读全文
posted @ 2020-09-11 21:35 然终酒肆 阅读(6187) 评论(0) 推荐(1) 编辑
摘要:计算机的随机数都是由伪随机数,即是由小M多项式序列生成的,其中产生每个小序列都有一个初始值,即随机种子。(注意: 小M多项式序列的周期是65535,即每次利用一个随机种子生成的随机数的周期是65535,当你取得65535个随机数后它们又重复出现了。) 我们知道rand()函数可以用来产生随机数,但是 阅读全文
posted @ 2020-09-10 22:36 然终酒肆 阅读(1117) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/zeze/p/5902124.html 阅读全文
posted @ 2020-09-08 19:36 然终酒肆 阅读(90) 评论(0) 推荐(0) 编辑
摘要:例如这样 原因是被墙了 个人搭**后完美解决 阅读全文
posted @ 2020-09-08 19:22 然终酒肆 阅读(107) 评论(0) 推荐(0) 编辑
摘要:首先 开始我读论文时 也是恨不得吃透每个单词 但是后来转念一想 没必要每个单词都弄懂 因为 一些程度副词 修饰性的形容词等 这些只能增强语气罢了 对文章主题的理解并没有天大的帮助 而读文章应该首先把握主旨 我们应该首要关注 标题 关键词 去通读一遍把握主旨 然后精读重要部分 接着提炼收获 读论文的步 阅读全文
posted @ 2020-09-06 09:34 然终酒肆 阅读(655) 评论(0) 推荐(0) 编辑
摘要:Oblivious polynomial evaluation is a protocol involving two parties, a sender whose input is a polynomial P, and a receiver whose input is a value $\a 阅读全文
posted @ 2020-09-05 09:53 然终酒肆 阅读(178) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/ysix7/article/details/64521786 写的很好 看懂了 RSA 算法对于乘法操作是同态的。 Paillier 算法则是对加法同态的。 Gentry算法则是全同态的 加法同态:满足E(X)E(Y)=E(X+Y)。典型的例子为:椭圆曲线 阅读全文
posted @ 2020-09-05 09:45 然终酒肆 阅读(1608) 评论(0) 推荐(1) 编辑
摘要:是是系统分辨率不同导致的问题 Alt+鼠标左键 (16.04版本亲测有效,18.04版本亲测无效)或者Win+鼠标左键 (18.04版本亲测有效)拖动安装界面,即可显示内容。 阅读全文
posted @ 2020-09-04 11:43 然终酒肆 阅读(1936) 评论(0) 推荐(1) 编辑
摘要:我老是忘这个 1、概念 RAM即随机存储内存,这种存储器在断电时将丢失其存储内容,故主要用于存储短时间使用的程序。ROM即只读内存,是一种只能读出事先所存数据的固态半导体存储器。 2、对比 手机中的RAM和ROM分别对应电脑的内存和硬盘,内存负责程序的运行以及数据交换,有了它,电脑中的软件才能运行, 阅读全文
posted @ 2020-09-03 10:46 然终酒肆 阅读(337) 评论(0) 推荐(0) 编辑
摘要:主要最近要用的上 才整理一下 用string类别忘了导入头文件 #include <string> 注意这个细节:cout 可直接输出 string 类的对象的内容 但是printf不可以 需要转化成char指针 #include <string> #include <iostream> #incl 阅读全文
posted @ 2020-09-03 08:52 然终酒肆 阅读(402) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示