Topic Portal
1 /*2 Find the law: Look at the first 10 items can see the law, make a table on the line. Was the LLD pit once: (3 */4#include <cstdio>5#include <algorithm>6#include <iostream>7#include <cstring>8#include <cmath>9#include <string>Ten#include <vector> One#include <queue> A#include <map> -#include <Set> -#include <ctime> the#include <cstdlib> - using namespacestd; - -typedefLong Longll; + Const intMAXN = 1e2 +Ten; - Const intINF =0x3f3f3f3f; + ll DP[MAXN]; A at voidSolvevoid) - { -dp[1] = dp[2] = dp[3] =1; -dp[4] = dp[5] =2; dp[6] =3; - for(intI=7; i<= -; ++i) - { inDp[i] = dp[i-1] + dp[i-5]; - } to } + - intMainvoid)//uvalive 6506 Padovan Sequence the { * //freopen ("g.in", "R", stdin); $ Panax Notoginseng solve (); - intT scanf ("%d", &t); the while(t--) + { A intN scanf ("%d", &n); theprintf ("%lld\n", Dp[n]); + } - $ return 0; $}
Find regular uvalive 6506 Padovan Sequence