上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 54 下一页
  2023年4月21日
摘要: 给你一个递增序列的第一位a1,最后一位an,求有多少个序列满足: 以a1为首,an为尾 1、B(1) = A(1) 2、后面每项满足 A[j]=B[j], A(j-1) < B(j) ≤ A(j), 且bj能整除A(j) - A(j-1)。 F[ i ] [ j ] 最后一位为j 的方案数 #inc 阅读全文
posted @ 2023-04-21 22:09 towboat 阅读(66) 评论(0) 推荐(0)
摘要: const int N =1e5+4; int fac[N] ,fm[N]; inline int kpow(int a, int b) { int res = 1; for (; b; b >>= 1) { if (b & 1) res = res * a % mod; a = a * a % m 阅读全文
posted @ 2023-04-21 16:56 towboat 阅读(311) 评论(0) 推荐(0)
摘要: Devu 有 n 个花瓶,第 ii 个花瓶里有 fi 朵花。他现在要选择 s 朵花。 你需要求出有多少种方案。两种方案不同当且仅当两种方案中至少有一个花瓶选择花的数量不同 可重复集的组合数 Ce( n,m) = C(m-1,m+n-1 ) namo用容斥原理 #include<iostream> # 阅读全文
posted @ 2023-04-21 16:49 towboat 阅读(72) 评论(0) 推荐(0)
  2023年4月20日
摘要: #include <iostream> #include <cstring> #include <queue> using namespace std; const int N=2e5+2; #define int long long int n,m,f1[50][2000] ,f2[50][200 阅读全文
posted @ 2023-04-20 22:04 towboat 阅读(36) 评论(0) 推荐(0)
摘要: 求 1∼n 的排列 A 中,满足前 m 个数中,刚好有 K 个数使得 A[ i ]=i 的 AA 的个数。 错位排列 #include<bits/stdc++.h> using namespace std; const int mod=1e9+7; #define int long long int 阅读全文
posted @ 2023-04-20 02:06 towboat 阅读(49) 评论(0) 推荐(0)
  2023年4月19日
摘要: 给定空间里的 n 个点,其中没有三点共线。每两个点之间都用红色或黑色的线段连接。 求 3 条边同色的三角形个数。 n≤1000n≤1000。 同色的= 总数- 杂色的 杂色的直接乘法原理就行,但注意ij 和ji 一样 #include <iostream> #include <cstring> #i 阅读全文
posted @ 2023-04-19 20:52 towboat 阅读(27) 评论(0) 推荐(0)
摘要: 写下区间[a,b]的所有数 ,问一共有多少个 0 #include <iostream> #include <cstring> #include <vector> using namespace std; #define int long long int n,f[40][40][2][2] ; v 阅读全文
posted @ 2023-04-19 20:12 towboat 阅读(49) 评论(0) 推荐(0)
摘要: 定问在[A,B] 中,有多少个整数本身能被m整除,各个数位上数字之和也能被m整除? #include <iostream> #include <cstring> #include <vector> using namespace std; vector<int> a; int m,f[40][105 阅读全文
posted @ 2023-04-19 16:49 towboat 阅读(38) 评论(0) 推荐(0)
  2023年4月18日
摘要: 给出一棵树的 dfs 序,求可能的构成方案数。 A______A_______ f[l ][ r] =sum{ f[l+1][k-1] *f[k][j] } #include <iostream> #include <cstring> #include <sstream> using namespa 阅读全文
posted @ 2023-04-18 21:58 towboat 阅读(42) 评论(0) 推荐(0)
摘要: 你有一个n×m的网格图,现在你要将K个人放在网格中,满足一下条件: 网格图的四个边都至少有一个人。 每个格子上不能有两个人。 每个人必须都有位置。 注意:四个角的人可以同时算作在两个边上 容斥原理 J=0 时就是 allAnswer #include <iostream> #include <cst 阅读全文
posted @ 2023-04-18 20:59 towboat 阅读(56) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 54 下一页