![](https://img-blog.csdnimg.cn/20200731162147867.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
背包dp类
背包类型, dp(暂时)
菜鸡一号¥
我很懒,没有加任何个人简介
展开
-
K - PhD math Gym - 100814K
K - PhD math Gym - 100814K K - PhD math Gym - 100814K 题干见上面链接,题意大致为给出a,b,n;让我们构造出a/b的前n位数字组成的数字序列组成一个n位数。给出p让我们找出所有子数字序列中能整除p的个数。 思路:这道题目构造出number序列来之后,可以对于p进行每一位的除模运算,然后找到这些位的同余个数对于同余位就是以他们为起止的子序列可以被p整除,然后这样的话找到每一个余数的个数用num*(num-1)/2,可以直接得到这一种余数为起止的个数。 代码原创 2021-03-17 20:07:25 · 131 阅读 · 0 评论 -
J - The King‘s Walk Kattis - kingswalk
借鉴博客 题目链接:J - The King’s Walk Kattis #include <iostream> #include <bits/stdc++.h> using namespace std; #define lowbit(x) x&(-x); typedef pair<int,int> PII; typedef long long ll; const int mod = 5318008; const int INF = 0x3f3f3f3f; con原创 2021-03-13 09:53:37 · 82 阅读 · 0 评论 -
最长上升子序列下降子序列模板。
#include <iostream> #include <algorithm> using namespace std; const int N = 1010; int n; int a[N]; int f[N], g[N]; int main() { scanf("%d", &n); for(int i=1; i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=n;i++)//求最长下原创 2021-01-19 11:03:54 · 61 阅读 · 0 评论 -
Coins HDU - 2844 ,梦幻题目,从迷迷糊糊到渐渐明朗
Coins HDU - 2844 题目链接: https://vjudge.net/problem/HDU-2844 先看看我比这之前整理出来的模板样式: #include <iostream> #include <cstdio> #include <cstdlib> #include <string.h> #include <cstring> #include <algorithm> #include <string> #原创 2020-07-31 18:31:43 · 127 阅读 · 0 评论