首页 > 其他分享 >HDU 5366

HDU 5366

时间:2023-08-15 17:32:07浏览次数:54  
标签:HDU 5366 jongs mook jong want put ZJiaQ


The mook jong

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 326    Accepted Submission(s): 252

Problem Description
![](../../data/images/C613-1001-1.jpg)
ZJiaQ want to become a strong man, so he decided to play the mook jong。ZJiaQ want to put some mook jongs in his backyard. His backyard consist of n bricks that is 1*1,so it is 1*n。ZJiaQ want to put a mook jong in a brick. because of the hands of the mook jong, the distance of two mook jongs should be equal or more than 2 bricks. Now ZJiaQ want to know how many ways can ZJiaQ put mook jongs legally(at least one mook jong).
 
Input
There ar multiply cases. For each case, there is a single integer n( 1 < = n < = 60)
 
Output
Print the ways in a single line for each case.
 
Sample Input
1
2
3
4
5
6
 
Sample Output
1
2
3
5
8

12

#include <stdio.h>

__int64 a[61];

int main()
{
    a[1]=1;
    a[2]=2;
    a[3]=3;
    for(int i=4;i<61;i++)
    {
        a[i]=a[i-1]+a[i-3]+1;
    }
    int n;
    while(~scanf("%d",&n))
    {
        printf("%I64d\n",a[n]);
    }

    return 0;
}




标签:HDU,5366,jongs,mook,jong,want,put,ZJiaQ
From: https://blog.51cto.com/u_3936220/7091429

相关文章

  • HDU 2444
    TheAccomodationofStudentsTimeLimit:5000/1000MS(Java/Others)  MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):3561  AcceptedSubmission(s):1656ProblemDescriptionThereareagroupofstudents.Someofthemmayknoweachother,......
  • HDU 1698(线段树 区间更新)
    JustaHookTimeLimit:4000/2000MS(Java/Others)    MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):23481    AcceptedSubmission(s):11758ProblemDescriptionInthegameofDotA,Pudge’smeathookisactuallythemosthorr......
  • HDU 3829 Cat VS Dog 猫和狗(二分图)结题报告
    听学长说这道题很ex,但是思路想到的话还是挺简单的。可能是受上一道题(放置机器人)的启发,也是找互相冲突的点连线。但是并不是完全一样(废话)放置机器人那道题是找到冲突点连线后直接求最大匹配即可。这道题稍微把思路变换一下,求出最大完美匹配数\(n\)后,说明有\(n*2\)个人的喜好......
  • HDU7326 string magic(Easy Version)
    HDU7326stringmagic(EasyVersion)tag:回文自动机题目链接题意:多组样例,每组输入一字符串(长度1e5以内),输出满足下列条件的子串个数:该串由两个完全相同的回文串拼接而成做法:字符串的题目一般都比较板,洛谷的P4287可以说是这道题目的原题,我们先看看原题是怎么做的P4287双......
  • hdu7365 0 vs 1
    0vs1首先如果两端不同肯定只能直接选。两端都选不了直接失败。不妨设现在是zero在选,从左边来010101交替,如果先出现了一个00比如01010100.....10那么我们就能从这边选,因为one只能跟着我们选这边,最后会出现两边都是0的情况。从右边来同理。假如是0101010交替,那么肯定是平......
  • HDU 多校 Round #6 题解
    HDU多校Round#6题解\(\text{ByDaiRuiChen007}\)A.CountProblemLink题目大意求有多少个长度为\(n\),字符集大小为\(m\)的字符串有长度为\(n-k\)的周期。数据范围:\(n,m,k\le10^{18}\)。思路分析\(k=n\)时答案为\(m^n\),否则转为有长度为\(k\)的Border,答案......
  • ## HDU7328 Snake
    HDU7328Snaketag:容斥,生成函数题目链接题意:1到n个数,分成m组,组队元素排列顺序不同则为不同的组,且每组元素个数不能超过k,问有多少种方案。容斥做法:暂且不管排列的事情,先把问题看成求n个球,m个盒子,盒子不能为空,且每个盒子中球数不能超过k。要保证每盒球数不超过k,我们可通过容......
  • HDU 暑假多校 2023 第六场
    目录写在前面733673417345733773397338写在最后写在前面补题地址:https://acm.hdu.edu.cn/listproblem.php?vol=64,题号7336~7346。哈哈,单刷5题,我是只会做套路题的飞舞。Boc'z那个单曲太牛逼了,最喜欢的一首,但是live上唱的这首是真难绷。以下按个人向难度排序。7336显然......
  • #轮廓线dp#HDU 1400 Mondriaan's Dream
    题目传送门分析状压dp会TLE,考虑用轮廓线dp,设\(dp[i][j][S]\)表示现在处理到\((i,j)\)这个位置轮廓线上状态为\(S\)的情况二进制位为1表示左边或者上方有骨牌跨过轮廓线,然后分类讨论转移一下即可代码#include<cstdio>#include<cstring>usingnamespacestd;con......
  • HDU7331 另解
    \[\begin{aligned}ANS&=\sum_{i=1}^n\binom{n}{i}p^i(1-p)^{n-i}\left(\sum_{j=1}^ij^m\right)&p=\frac{a}{b}\\&=\sum_{j=1}^nj^m\sum_{i=j}^n\binom{n}{i}p^i(1-p)^{n-i}\\&=\sum_{j=1}^n\sum_{k=0}^m{m\bracek}\binom{j}{k}k!\su......