摘要: 题目:http://hustoj.sinaapp.com/problem.php?id=1816经过计算对比两组数据 注意数据范围是long long#include<stdio.h>int main(){ char ufo[10]; char group[10]; long long ufon=1; long long groupn=1; scanf("%s",ufo); scanf("%s",group); for(int i=0;ufo[i]!='\0';i++) { ufon*=ufo[i]-'A'+1 阅读全文
posted @ 2012-12-23 22:27 Daniel Qiu 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 高中同学问了我一道题,开始以为简单循环就能完成,后来发现原来是道深搜题,一开始还没想出来...问题描述给1到N,N个数,要你从中选取M个出来,请输出每一种的选取情况(根据序列字典序输出,即两个序列比大小,第一位小的小,若相等第二位小的小,若相等第三位小的小……)。 样例输入4 3样例输出1 2 3 1 2 4 1 3 4 2 3 4#include<stdio.h>int ans[10];void dfs(int start,int has,int n,int m){ if(has==m) { for(int i=0;i<m;i++)printf("%d " 阅读全文
posted @ 2012-12-23 21:18 Daniel Qiu 阅读(293) 评论(0) 推荐(0) 编辑