HDOJ 2013 蟠桃记

来源:互联网 发布:游乐网软件下载 编辑:程序博客网 时间:2024/06/05 03:15

        根据题意,递推求解就好。

#include <cstdio>//#define yangyuanint main(){#ifdef yangyuanfreopen("in", "r", stdin);#endif // yangyuan    int n;    while (scanf("%d", &n) != EOF){        int total = 1;        while (--n)            total = (total + 1) << 1;        printf("%d\n", total);}    return 0;}