摘要:
Problem Description又到了选课的时间了,xhd看着选课表发呆,为了想让下一学期好过点,他想知道学n个学分共有多少组合。你来帮帮他吧。(xhd认为一样学分的课没区别)Input输入数据的第一行是一个数据T,表示有T组数据。每组数据的第一行是两个整数n(1 #include using namespace std;int c[45],temp[45];int a[11],b[11];int main(){ int t;cin>>t; int n,k; while(t--) { cin>>n>>k; for(int i=1;i>a... 阅读全文
摘要:
Word IndexTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 4541Accepted: 2567DescriptionEncoding schemes are often used in situations requiring encryption or information storage/transmission economy. Here, we develop a simple encoding scheme that encodes particular types of words with five o 阅读全文
摘要:
Game of ConnectionsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2923Accepted Submission(s): 1649Problem DescriptionThis is a small but ancient game. You are supposed to write down the numbers 1, 2, 3, ... , 2n - 1, 2n consecutively in clockwise 阅读全文
摘要:
代码:#include #include using namespace std;int c[11][11];void init(){ memset(c,0,sizeof(c)); c[0][0]=c[1][0]=c[1][1]=1; for(int i=2;i<=10;i++) { c[i][0]=c[i][i]=1; for(int j=1;j<i;j++) c[i][j]=c[i-1][j]+c[i-1][j-1]; }}int main(){ init(); cout<<c[3][2]<<end... 阅读全文
摘要:
排列组合Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2132Accepted Submission(s): 877Problem Description有n种物品,并且知道每种物品的数量。要求从中选出m件物品的排列数。例如有两种物品A,B,并且数量都是1,从中选2件物品,则排列有"AB","BA"两种。Input每组输入数据有两行,第一行是二个数n,m(1#include #include #incl 阅读全文