标签:awl import == ret 递归 应该 form limit term
Description
Input
Output
Sample Input
Sample Output
#include <iostream> #include <cstdio> #include<stdio.h> #include<algorithm> #include<cstring> #include<math.h> #include<memory> #include<queue> #include<vector> using namespace std; int f(int n) { int s=1; for(int i=1;i<=n;i++) { s=s*2; } return s; } int slove(int m,int n) { if(m==0) return n+1; if(m==1) return n+2; if(m==2) return 2*n+3; if(m==3) return f(n+3)-3; } int main() { int n,m; while(~scanf("%d %d",&m,&n)) { printf("%d\n",slove(m,n)); } return 0; }
HDU 1165 Eddy's research II(给出递归公式,然后找规律)
标签:awl import == ret 递归 应该 form limit term
原文地址:https://www.cnblogs.com/yinbiao/p/9445188.html