上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 54 下一页
  2023年4月21日
摘要: Devu 有 n 个花瓶,第 ii 个花瓶里有 fi 朵花。他现在要选择 s 朵花。 你需要求出有多少种方案。两种方案不同当且仅当两种方案中至少有一个花瓶选择花的数量不同 可重复集的组合数 Ce( n,m) = C(m-1,m+n-1 ) namo用容斥原理 #include<iostream> # 阅读全文
posted @ 2023-04-21 16:49 towboat 阅读(34) 评论(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 阅读(13) 评论(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 阅读(19) 评论(0) 推荐(0)
  2023年4月19日
摘要: 给定空间里的 n 个点,其中没有三点共线。每两个点之间都用红色或黑色的线段连接。 求 3 条边同色的三角形个数。 n≤1000n≤1000。 同色的= 总数- 杂色的 杂色的直接乘法原理就行,但注意ij 和ji 一样 #include <iostream> #include <cstring> #i 阅读全文
posted @ 2023-04-19 20:52 towboat 阅读(14) 评论(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 阅读(16) 评论(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 阅读(19) 评论(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 阅读(13) 评论(0) 推荐(0)
摘要: 你有一个n×m的网格图,现在你要将K个人放在网格中,满足一下条件: 网格图的四个边都至少有一个人。 每个格子上不能有两个人。 每个人必须都有位置。 注意:四个角的人可以同时算作在两个边上 容斥原理 J=0 时就是 allAnswer #include <iostream> #include <cst 阅读全文
posted @ 2023-04-18 20:59 towboat 阅读(36) 评论(0) 推荐(0)
  2023年4月17日
摘要: 你需要将 n 个集合分成尽量多组,使得每一组里面所有集合的并集等于全集 3 2 1 2 2 0 2 2 0 1 4 1 1 1 0 1 3 1 2 0 f[S]= max(f[S], f[S-j] +1 ) 且 j是一个包含所有点的集合 #include <iostream> #include <a 阅读全文
posted @ 2023-04-17 23:12 towboat 阅读(17) 评论(0) 推荐(0)
摘要: 有n个垃圾,第i个垃圾的坐标为(xi,yi),重量为wi。 有一个机器人,要按照编号从小到大的顺序捡起所有垃圾并扔进垃圾桶(垃圾桶在原点(0,0))。 机器人可以捡起几个垃圾以后一起扔掉,但任何时候其手中的垃圾总重量不能超过最大载重C。两点间的行走距离为曼哈顿距离(即横坐标之差的绝对值加上纵坐标之差 阅读全文
posted @ 2023-04-17 21:37 towboat 阅读(25) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 54 下一页