08 2018 档案

摘要:1001:HDU6397 Character Encoding 公式题,可以用容斥和隔板法推出来。 #include <iostream> #include <cstdio> #include <cstdlib> using namespace std; const int MAX=3e5+5; c 阅读全文
posted @ 2018-08-19 20:38 Hetui 阅读(328) 评论(0) 推荐(0)
摘要:A: Circulant Matrix 已知序列a和x的fwt结果是b,知道a和b求x。 其实就是FWT的逆过程。先对b做ufwt,对a做fwt,然后x就是b/a。之后对得到的x做一遍fwt即可。 #include <cstdio> #include <cstdlib> #include <iost 阅读全文
posted @ 2018-08-19 20:30 Hetui 阅读(500) 评论(0) 推荐(0)
摘要:1001:Age of Moyu 在SPFA的时候开一个set或map记录一下转移到他的边的种类,转移的时候尽量选和当前这条边种类一样的边转移,玄学复杂度,记得fread读入挂和register进行常数优化。 1 #include<bits/stdc++.h> 2 3 #define maxn 10 阅读全文
posted @ 2018-08-14 19:53 Hetui 阅读(342) 评论(0) 推荐(0)
摘要:A:Singing Contest 模拟题,在胜者树上模拟即可,最优策略很容易,要赢的人选比对方最大的数还要大的而且尽量小的歌就行 #include<bits/stdc++.h> #define maxn 15 using namespace std; set <int> s[1<<maxn]; i 阅读全文
posted @ 2018-08-05 10:16 Hetui 阅读(142) 评论(0) 推荐(0)
摘要:A:gpa 分数规划裸题了吧,然后二分次数过多的话会超时 #include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; const int MAX=1e5+5; int n, 阅读全文
posted @ 2018-08-05 09:41 Hetui 阅读(163) 评论(0) 推荐(0)
摘要:1001:Problem A. Integers Exhibition 重要结论:一个数如果是k-magic数,那么它的倍数也是k-magic数。 发现非k-magic数很少 一开始知道1是非k-magic数。从小到大枚举质数。 对于每个质数p,将已知的数乘以p的幂加入数列直到超出上限,然后筛掉全部 阅读全文
posted @ 2018-08-05 09:36 Hetui 阅读(161) 评论(0) 推荐(0)