hdu 2042】的更多相关文章

题意:(略)太长了 解法:找规律,发现A[i]=A[i-1]*2-2; 1: #include<stdlib.h> 2: #include<string.h> 3: #include<stdio.h> 4: #include<math.h> 5: #define N 31 6: int a[N]={3}; 7: void init(){ 8: int i; 9: for(i=1;i<N;i++){ 10: a[i]=a[i-1]*2-2;//这个就是递…
Ps:...好简单的一道题...直接AC,就是利用递归 代码: #include "stdio.h"int find(int num,int n);int main(){ int n,i,m; while(~scanf("%d",&n)){  for(i=0;i<n;i++){   scanf("%d",&m);   printf("%d\n",find(3,m));  } } return 0;}int…
不容易系列之二 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 19635    Accepted Submission(s): 15810 Problem Description 你活的不容易,我活的不容易,他活的也不容易.不过,如果你看了下面的故事,就会知道,有位老汉比你还不容易. 重庆市郊黄泥板村的徐老汉(大号徐东海,简称XDH)…
这种递归来写,除了递归我也想不到怎么写了 AC代码: #include<iostream>using namespace std;int x[41];//打表,不打表我不用想就知道过不了,再水也是ACM的题.int resum(int n){ if(n==1)//第一个阶梯多少种方法 return 0; if(n==2)//第二个阶梯多少种方法 return 1; if(n==3)//第三个阶梯多少种方法 return 2; if(x[n]>0)//查看表里有无数据 return x[n…
下面继续给出HDU 2033~2043的AC程序,供大家参考.2033~2043这10道题就被归结为“ACM程序设计期末考试(2006/06/07) ”和“2005实验班短学期考试 ”. HDU 2033:人见人爱A+B 简单分支结构. #include <stdio.h> int main() { int n,ah,am,as,bh,bm,bs; scanf("%d",&n); while (n--) { scanf("%d%d%d%d%d%d"…
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 1084 1088 1106 1107 1113 1117 1119 1128 1129 1144 1148 1157 1161 1170 1172 1177 1197 1200 1201…
不容易系列之一 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13566    Accepted Submission(s): 5660 Problem Description 大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了!做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的…
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008.1012.1013.1014.1017.1019.1021.1028.1029.1032.1037.1040.1048.1056.1058.1061.1070.1076.1089.1090.1091.1092.1093.1094.1095.1096.1097.1098.1106.1108.1157…
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 1084 1088 1106 1107 1113 1117 1119 1128 1129 1144 1148 1157 1161 1170 1172 1177 1197 1200 1201 120…
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember history, King plans to play losephus problem in the parade gap.He calls n(1≤n≤5000) soldiers, counterclockwise in a circle, in label 1,2,3...n. The firs…