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)
摘要: define S ,it is sum of all possible permutationsof a given set of digits. For example, if the digits are <1 2 3>, then six possible permutations are<1 阅读全文
posted @ 2023-04-17 21:04 towboat 阅读(18) 评论(0) 推荐(0)
摘要: 求1~2^64 区间里, 有多少合法数X 合法数: X= a^b ,至少存在2个不同的a #include <iostream> #include <algorithm> #include <vector> using namespace std; const int N =65536+3; int 阅读全文
posted @ 2023-04-17 20:24 towboat 阅读(25) 评论(0) 推荐(0)
摘要: 给出n, 求有多少对(a,b) (a<b), 满足 LCM(a,b) =n 暴力求所有因数 #include <iostream> #include <algorithm> #include <vector> using namespace std; const int N =1e4+20; #de 阅读全文
posted @ 2023-04-17 16:35 towboat 阅读(17) 评论(0) 推荐(0)
摘要: 给定 m,n ,求最大的 k 使得 m^k∣n! 分解质因数 #include <iostream> #include <cstring> #include <sstream> using namespace std; const int N =1e4+20; const int inf =1e9 阅读全文
posted @ 2023-04-17 15:45 towboat 阅读(22) 评论(0) 推荐(0)
摘要: 两个数 n,m,求 用 m 个 [0,n] 的整数相加使其和为 n 的方案数。 #include <iostream> #include <cstring> #include <sstream> using namespace std; const int N =102; const int mod 阅读全文
posted @ 2023-04-17 14:57 towboat 阅读(18) 评论(0) 推荐(0)
摘要: lcm(a,b)=c 给a,c ,求最小的b 质因数分解的好题 #include <iostream> #include <cstring> #include <sstream> using namespace std; #define int long long int a,b,c; int cn 阅读全文
posted @ 2023-04-17 02:30 towboat 阅读(13) 评论(0) 推荐(0)