虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

3.<b>90</b>

  • RSA算法 :首先, 找出三个数, p, q, r, 其中 p, q 是两个相异的质数, r 是与 (p-1)(q-1) 互质的数...... p, q, r 这三个数便是 person_key

    RSA算法 :首先, 找出三个数, p, q, r, 其中 p, q 是两个相异的质数, r 是与 (p-1)(q-1) 互质的数...... p, q, r 这三个数便是 person_key,接著, 找出 m, 使得 r^m == 1 mod (p-1)(q-1)..... 这个 m 一定存在, 因为 r 与 (p-1)(q-1) 互质, 用辗转相除法就可以得到了..... 再来, 计算 n = pq....... m, n 这两个数便是 public_key ,编码过程是, 若资料为 a, 将其看成是一个大整数, 假设 a < n.... 如果 a >= n 的话, 就将 a 表成 s 进位 (s

    标签: person_key RSA 算法

    上传时间: 2013-12-14

    上传用户:zhuyibin

  • The government of a small but important country has decided that the alphabet needs to be streamline

    The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d . Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet. Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1. Definition

    标签: government streamline important alphabet

    上传时间: 2015-06-09

    上传用户:weixiao99

  • 上下文无关文法(Context-Free Grammar, CFG)是一个4元组G=(V, T, S, P)

    上下文无关文法(Context-Free Grammar, CFG)是一个4元组G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一组有限的产生式规则集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素称为非终结符,T的元素称为终结符,S是一个特殊的非终结符,称为文法开始符。 设G=(V, T, S, P)是一个CFG,则G产生的语言是所有可由G产生的字符串组成的集合,即L(G)={x∈T* | Sx}。一个语言L是上下文无关语言(Context-Free Language, CFL),当且仅当存在一个CFG G,使得L=L(G)。 *⇒ 例如,设文法G:S→AB A→aA|a B→bB|b 则L(G)={a^nb^m | n,m>=1} 其中非终结符都是大写字母,开始符都是S,终结符都是小写字母。

    标签: Context-Free Grammar CFG

    上传时间: 2013-12-10

    上传用户:gaojiao1999

  • We have a group of N items (represented by integers from 1 to N), and we know that there is some tot

    We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.

    标签: represented integers group items

    上传时间: 2016-01-17

    上传用户:jeffery

  • 离散实验 一个包的传递 用warshall

     实验源代码 //Warshall.cpp #include<stdio.h> void warshall(int k,int n) { int i , j, t; int temp[20][20]; for(int a=0;a<k;a++) { printf("请输入矩阵第%d 行元素:",a); for(int b=0;b<n;b++) { scanf ("%d",&temp[a][b]); } } for(i=0;i<k;i++){ for( j=0;j<k;j++){ if(temp[ j][i]==1) { for(t=0;t<n;t++) { temp[ j][t]=temp[i][t]||temp[ j][t]; } } } } printf("可传递闭包关系矩阵是:\n"); for(i=0;i<k;i++) { for( j=0;j<n;j++) { printf("%d", temp[i][ j]); } printf("\n"); } } void main() { printf("利用 Warshall 算法求二元关系的可传递闭包\n"); void warshall(int,int); int k , n; printf("请输入矩阵的行数 i: "); scanf("%d",&k); 四川大学实验报告 printf("请输入矩阵的列数 j: "); scanf("%d",&n); warshall(k,n); } 

    标签: warshall 离散 实验

    上传时间: 2016-06-27

    上传用户:梁雪文以

  • 道理特分解法

    #include "iostream" using namespace std; class Matrix { private: double** A; //矩阵A double *b; //向量b public: int size; Matrix(int ); ~Matrix(); friend double* Dooli(Matrix& ); void Input(); void Disp(); }; Matrix::Matrix(int x) { size=x; //为向量b分配空间并初始化为0 b=new double [x]; for(int j=0;j<x;j++) b[j]=0; //为向量A分配空间并初始化为0 A=new double* [x]; for(int i=0;i<x;i++) A[i]=new double [x]; for(int m=0;m<x;m++) for(int n=0;n<x;n++) A[m][n]=0; } Matrix::~Matrix() { cout<<"正在析构中~~~~"<<endl; delete b; for(int i=0;i<size;i++) delete A[i]; delete A; } void Matrix::Disp() { for(int i=0;i<size;i++) { for(int j=0;j<size;j++) cout<<A[i][j]<<" "; cout<<endl; } } void Matrix::Input() { cout<<"请输入A:"<<endl; for(int i=0;i<size;i++) for(int j=0;j<size;j++){ cout<<"第"<<i+1<<"行"<<"第"<<j+1<<"列:"<<endl; cin>>A[i][j]; } cout<<"请输入b:"<<endl; for(int j=0;j<size;j++){ cout<<"第"<<j+1<<"个:"<<endl; cin>>b[j]; } } double* Dooli(Matrix& A) { double *Xn=new double [A.size]; Matrix L(A.size),U(A.size); //分别求得U,L的第一行与第一列 for(int i=0;i<A.size;i++) U.A[0][i]=A.A[0][i]; for(int j=1;j<A.size;j++) L.A[j][0]=A.A[j][0]/U.A[0][0]; //分别求得U,L的第r行,第r列 double temp1=0,temp2=0; for(int r=1;r<A.size;r++){ //U for(int i=r;i<A.size;i++){ for(int k=0;k<r-1;k++) temp1=temp1+L.A[r][k]*U.A[k][i]; U.A[r][i]=A.A[r][i]-temp1; } //L for(int i=r+1;i<A.size;i++){ for(int k=0;k<r-1;k++) temp2=temp2+L.A[i][k]*U.A[k][r]; L.A[i][r]=(A.A[i][r]-temp2)/U.A[r][r]; } } cout<<"计算U得:"<<endl; U.Disp(); cout<<"计算L的:"<<endl; L.Disp(); double *Y=new double [A.size]; Y[0]=A.b[0]; for(int i=1;i<A.size;i++ ){ double temp3=0; for(int k=0;k<i-1;k++) temp3=temp3+L.A[i][k]*Y[k]; Y[i]=A.b[i]-temp3; } Xn[A.size-1]=Y[A.size-1]/U.A[A.size-1][A.size-1]; for(int i=A.size-1;i>=0;i--){ double temp4=0; for(int k=i+1;k<A.size;k++) temp4=temp4+U.A[i][k]*Xn[k]; Xn[i]=(Y[i]-temp4)/U.A[i][i]; } return Xn; } int main() { Matrix B(4); B.Input(); double *X; X=Dooli(B); cout<<"~~~~解得:"<<endl; for(int i=0;i<B.size;i++) cout<<"X["<<i<<"]:"<<X[i]<<" "; cout<<endl<<"呵呵呵呵呵"; return 0; } 

    标签: 道理特分解法

    上传时间: 2018-05-20

    上传用户:Aa123456789

  • 三相交流调压电路的matlab仿真设计

    工作原理分析,主要分析电阻负载时的情况:1,任一相导通须和另一相构成回路,因此,和三相全控整流电路一样,电流流通路径中有两个晶闸管,所以应采用双脉冲或宽脉冲触发。2,三相的触发脉冲依次相差120",同一相的两个反并联晶闸管触发脉冲应相差180因此触发脉冲顺序和三相桥式全控整流电路一样,为VTI vT6,依次相差6003,如果把晶闸管换成二极管可以看出,相电流和相电压同相位,且相电压过零食二极管开始导通。因此把相电压过零点定为触发延迟角a的起点,三相三线电路中,两相间导通是靠线电压导通的,而线电压超前相电压30",因此,a角移范围是0~ 150根据任一时刻导通晶闸管个数及半个周波内电流是否连续,可将0"-150"的移相范围分为如下三段:(1)0"< a<60":电路处于三管导通与两管导通交替,每管导通180"-a。但a-0时是种特殊情况,一直是三管导通。(2)60"<a< 90:任一时刻都是两管导通,每管的导通角都是120(3)90"<a< 150":电路处于两管号通与无晶同管导通交替状态,每个晶闸管导通角为300-2a。而且这个导通角被分割为不连续的两部分,在半周波内形成两个断续的波头,各占150"-a.

    标签: 三相交流调压电路 matlab

    上传时间: 2022-06-22

    上传用户:bluedrops

  • 基于verilog HDL的自动售货机控制电路设计: 可以对5种不同种类的货物进行自动售货,价格分别为A=1.00,B=1.50,C=1.80,D=3.10,E=5.00 。售货机可以接受1元,5角

    基于verilog HDL的自动售货机控制电路设计: 可以对5种不同种类的货物进行自动售货,价格分别为A=1.00,B=1.50,C=1.80,D=3.10,E=5.00 。售货机可以接受1元,5角,1角三种硬币(即有三种输入信号IY,IWJ,IYJ),并且在一个3位7段LED(二位代表元,一位代表角)显示以投入的总钱数,最大9.90元,如果大于该数值,新投入的硬币会退出,选择货物的输入信号Ia,Ib,Ic,Id,Ie和一个放弃信号In,输出指示信号为 Sa, Sb ,Sc ,Sd, Se 分别表示售出相应的货物,同时输出的信号yuan, jiao代表找零,相应每个脉冲代表找零相应的硬币,上述输入和输出信号均是一个固定宽度的脉冲信号。

    标签: verilog 1.00 1.50 1.80

    上传时间: 2016-07-12

    上传用户:lanwei

  • 非均匀有理b样条曲线nurbs的C++源码库。 3.0.11版

    非均匀有理b样条曲线nurbs的C++源码库。 3.0.11版

    标签: nurbs 11 源码

    上传时间: 2015-04-24

    上传用户:Miyuki

  • Haskell 中文教程1-3章(flw译) 纯粹的函数型编程语言。以著名逻辑学家 Haskell B. Curry 的名字命名。 最初的目的是想要设计出满足下面这些要求的语言: 1

    Haskell 中文教程1-3章(flw译) 纯粹的函数型编程语言。以著名逻辑学家 Haskell B. Curry 的名字命名。 最初的目的是想要设计出满足下面这些要求的语言: 1,它必须能够适合教学、研究、应用开发,包括一些大系统的构造。 2,它必须能够使用形式语言来准确描述。 3,它必须是自由免费的,任何人只要愿意都可以获取、使用和再次发布它。 4,它必须建立在大家一致认可的基础上。 5,它应该能够消除目前的函数型编程语言的差异。

    标签: Haskell B. Curry flw

    上传时间: 2014-01-10

    上传用户:685