摘要:
Leftmost DigitTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionGiven a positive integer N, you should output the leftmost digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T which is the number of 阅读全文
摘要:
EncodingProblem DescriptionGiven a string containing only 'A' - 'Z', we could encode it using the following method:1. Each sub-string containing k same characters should be encoded to "kX" where "X" is the only character in this sub-string.2. If the length of the 阅读全文
摘要:
Design T-ShirtProblem DescriptionSoon after he decided to design a T-shirt for our Algorithm Board on Free-City BBS, XKA found that he was trapped by all kinds of suggestions from everyone on the board. It is indeed a mission-impossible to have everybody perfectly satisfied. So he took a poll to col 阅读全文
摘要:
{A} + {B}Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem Description给你两个集合,要求{A} + {B}.注:同一个集合中不会有两个相同的元素.Input每组输入数据分为三行,第一行有两个数字n,m(0<n,m<=10000),分别表示集合A和集合B的元素个数.后两行分别表示集合A和集合B.每个元素为不超出int范围的整数,每个元素之间有一个空格隔开.Output针对每组数据输出一行数据,表示合并后的集合,要求从小到大输出,每个元素之间 阅读全文
摘要:
完数Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem Description完数的定义:如果一个大于1的正整数的所有因子之和等于它的本身,则称这个数是完数,比如6,28都是完数:6=1+2+3;28=1+2+4+7+14。本题的任务是判断两个正整数之间完数的个数。Input输入数据包含多行,第一行是一个正整数n,表示测试实例的个数,然后就是n个测试实例,每个实例占一行,由两个正整数num1和num2组成,(1<num1,num2<10000) 。Output对 阅读全文
摘要:
测试你是否和LTC水平一样高Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem Description大家提到LTC都佩服的不行,不过,如果竞赛只有这一个题目,我敢保证你和他绝对在一个水平线上!你的任务是:计算方程x^2+y^2+z^2= num的一个正整数解。Input输入数据包含多个测试实例,每个实例占一行,仅仅包含一个小于等于10000的正整数num。Output对于每组测试数据,请按照x,y,z递增的顺序输出它的一个最小正整数解,每个实例的输出占一行,题目保证所有测 阅读全文
摘要:
Electron CloudTime Limit:2 Seconds Memory Limit:65536 KBThe electron is described in terms of its probability distribution or probability density. This probability distribution does not have definite cutoff points; its edges are somewhat fuzzy. Hence the term "electron cloud." This cloudy 阅读全文
摘要:
Easier Done Than Said?Problem DescriptionPassword security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (like xvtpzyo), but users have a hard time remembering them an 阅读全文
摘要:
int**malloc2d(intr,intc){inti;int**t=malloc(r*sizeof(int*));for(i=0;i<r;i++)t[i]=malloc(c*sizeof(int));returnt;}int**a=malloc2d(M,N)ps:矩阵相乘for(i=0;i<N;i++)for(j=0;j<N;j++)for(k=0,c[i][j]=0.0;k<N;k++) c[i][j]+=a[i][k]*b[k][j]; 阅读全文
摘要:
假设以顺序存储结构实现一个双向栈,即在一维数组的存储空间中存在着两个栈,它们的栈底分别设在数组的两个端点。试编写实现这个双向栈tws的三个操作:初始化inistack(tws)、入栈push(tws,i,x)和出栈pop(tws,i)的算法,其中i为0或1,用以分别指示设在数组两端的两个栈.C code:#include<stdio.h>#include<stdlib.h>#defineOK1#defineOVERFLOW-1#defineERROR1typedefintStatus;typedefstruct{int*base[2];int*top[2];}BDSta 阅读全文