摘要: D. Chloe and pleasant prizes time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Generous sp 阅读全文
posted @ 2017-02-19 20:30 cxhscst2 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 题目链接 Game 题目的意思很简单, 就是要找一棵树权值最大等等前K条链。 在本题中,走的次数等于min(叶子结点个数,k) tree[i].sum意为从i号结点出发走到某个叶子结点能得到的最大总价值。 pson[i]表示i号结点若要获得最大价值那么下一步该怎么走。 显然tree[i].sum和p 阅读全文
posted @ 2017-02-17 18:56 cxhscst2 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 题目链接 Treats for the Cows 直接区间DP就好了,用记忆化搜索是很方便的。 阅读全文
posted @ 2017-02-16 16:52 cxhscst2 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 4300: 绝世好题 Description 给定一个长度为$n$的数列$ai$,求$ai$的子序列$bi$的最长长度,满足bi&bi-1!=0(2<=i<=len) 给定一个长度为$n$的数列$ai$,求$ai$的子序列$bi$的最长长度,满足bi&bi-1!=0(2<=i<=len) Input 阅读全文
posted @ 2017-02-16 16:49 cxhscst2 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 类似筛素数的方法……求出前缀和。然后直接O(1)回答即可。 阅读全文
posted @ 2017-02-15 21:30 cxhscst2 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 根据叉乘判断。 阅读全文
posted @ 2017-02-14 22:51 cxhscst2 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 相离,相切,相交,内含这几种情况都考虑了。 阅读全文
posted @ 2017-02-14 22:47 cxhscst2 阅读(2582) 评论(0) 推荐(0) 编辑
摘要: 直接O(N^2)判断两线段是否相交即可。 阅读全文
posted @ 2017-02-14 22:46 cxhscst2 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 题目链接 Multipliers 阅读全文
posted @ 2017-02-14 13:17 cxhscst2 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 题目链接 Problem J 这道题思路还是很直观的,但是有两个难点: 1、题目中说$1<=NM<=10^{6}$,但没具体说明$N$和$M$的值,也就是可能出现: $N = 1, M = 1000000$ 这样的数据。 2、对每个查询的分类讨论。 #include <bits/stdc++.h> 阅读全文
posted @ 2017-02-13 10:27 cxhscst2 阅读(222) 评论(0) 推荐(0) 编辑