这题首先我们可以推出递推式: 我们先把加数个数大于等于 \(2\) 的限制去掉,最后再减回去即可。 \[ f_0=1 \] \[ f_n=\sum\limits_{i=1}^{n} j \cdot f_{i-j} \] 暴力代码: #include<bits/stdc++.h> using name ...
分类:
其他好文 时间:
2021-01-05 10:41:20
阅读次数:
0
#include<bits/stdc++.h> using namespace std; int n; void mysort(int a[],int l,int r)//自己写的快排 { int mid=a[(l+r)/2];//找中间的数进行2分 int i=l,j=r; do{ while(a ...
分类:
编程语言 时间:
2021-01-05 10:39:05
阅读次数:
0
给定一个整数n,将数字1~n排成一排,将会有很多种排列方法。 现在,请你按照字典序将所有的排列方法输出。 #include<bits/stdc++.h> using namespace std; int n,p[10]; bool k[10]; void out() { for(int i=1;i< ...
code: #include<bits/stdc++.h>//xfl using namespace std; const int N = 100007; typedef unsigned long long ull; ull mis[N],sum[N]; string s; int n,m,l1, ...
线性筛 #include<bits/stdc++.h> #define N 1000010 using namespace std; int v[N],p[N]; void pr(int n) { memset(v,0,sizeof(v)); int m=0; for(int i=2;i<=n;i+ ...
求把N*M的棋盘分割成若干个1*2的的长方形,有多少种方案。 j表示 n 位二进制数 1 表示有“突出” f[i][j]表示当前状态 f[i-1][k]是上一行的状态 if ((j&k)==0&&st[j|k]) f[i][j]+=f[i-1][k]; #include<bits/stdc++.h> ...
version: '3.3' # starts 4 docker containers running minio server instances. # using nginx reverse proxy, load balancing, you can access # it through p ...
分类:
其他好文 时间:
2020-12-30 11:23:53
阅读次数:
0
给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。 示例 1: 输入: 123 输出: 321 示例 2: 输入: -123 输出: -321 示例 3: 输入: 120 输出: 21 注意: 假设我们的环境只能存储得下 32 位的有符号整数,则其数值范围为 [?231, 23 ...
分类:
其他好文 时间:
2020-12-24 11:45:02
阅读次数:
0
实在不知道错哪了。。。 对着 std 检查了好几遍了QAQ 题解见注释(不过估计题解也是错的,不然为什么写错啊QAQ #include<bits/stdc++.h> using namespace std; const int N=1<<16; int m,n,a,b; double pr[N],s ...
分类:
其他好文 时间:
2020-12-24 11:31:40
阅读次数:
0
/*Hatsune Miku 4ever!*/ #include <bits/stdc++.h> using namespace std; typedef long long ll; #define _for(i,a,b) for(int i = (a);i < b;i ++) #define _r ...
分类:
其他好文 时间:
2020-12-23 11:47:45
阅读次数:
0