摘要: /*hdu6061[NTT推公式] 2017多校3*/ #include using namespace std; typedef long long LL; const LL MOD = 998244353; const int MAX_N = 1000000; int n, m, temp; LL a; LL inv[1000007]; LL Finv[1000007]; LL F[100... 阅读全文
posted @ 2017-08-02 21:02 UnderSilence 阅读(168) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; typedef long long LL; int trie[31 * 500005][2]; int no[31 * 500005]; int sz[31 * 500005]; int sum[31][2]; int T, n, temp, tot = 0; LL ans = 0; void solve(int x) { i... 阅读全文
posted @ 2017-08-02 16:36 UnderSilence 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 用一个双向链表来查找比当前元素大的前k-1个元素和后k-1个元素 ,从小到大枚举x,算完x的贡献后将x从链表中删除,优化到O(nk)。 阅读全文
posted @ 2017-08-02 13:44 UnderSilence 阅读(160) 评论(0) 推荐(0) 编辑
摘要: /* hdu6060[贪心+dfs] 2017多校3*/ #include using namespace std; typedef long long LL; int n, k, u, v, c; struct Edge { LL cost; int to; Edge(int C = 0, int T = 0): cost(C), to(T) {} }; vector... 阅读全文
posted @ 2017-08-02 13:39 UnderSilence 阅读(152) 评论(0) 推荐(0) 编辑