上一页 1 2 3 4 5 6 7 8 ··· 27 下一页
摘要: 要点 都在注释里了 C++ include include include include include using namespace std; typedef double db; const int maxn = 1e5 + 5; int n; db l, v1, v2; db a[maxn 阅读全文
posted @ 2019-06-11 09:24 AlphaWA 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 要点 题意:可以拐弯,即哈密顿距离 注意不可以直接一个一个搜,这过程中会把下一轮的标记上,导致同一轮的其它点没能正常完成应有的搜索 因此采用双层广搜,把同一轮先都出队列再的一起搜 C++ include include include include include include include 阅读全文
posted @ 2019-06-11 09:22 AlphaWA 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 要点 扫每个儿子时更新一次dp 阅读全文
posted @ 2019-06-10 15:53 AlphaWA 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 方法一 黑白棋盘拥有性质:(r + c) % 2的值决定颜色 因此把某色全部反转,直接求另一色的最大矩形即可,单调栈的经典问题 阅读全文
posted @ 2019-06-10 14:47 AlphaWA 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 要点 将边作为染色,如果交叉则异色 C++ include include include using namespace std; int n, m; int a[101], b[101], c[101]; int main() { scanf("%d %d", &n, &m); for (int 阅读全文
posted @ 2019-06-10 14:40 AlphaWA 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 要点 没想到的一点是,对于堆里的某牌,最好情况是它出来时后边都准备就绪了,答案是$p[i] + (n i + 1)$,所有的这个取最大的即可 一发结束的情况先特判一下 C++ const int maxn = 2e5 + 5; int n, pos, ans; int a[maxn], b[maxn 阅读全文
posted @ 2019-06-10 14:31 AlphaWA 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 虽然不是正解但毕竟自己做出来了还是记下来吧~ 对每个人分别dfs得到其期望,某两维的组合情况有限所以Hash一下避免了MLE。 C++ include include include include include using namespace std; const int maxn = 51, 阅读全文
posted @ 2019-06-10 14:22 AlphaWA 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 要点 用A、B、C一般式确定每条直线 将合法的圆心中点存到每条直线所属的vector中 枚举所有线段,二分后$O(1)$得到其中存在多少答案,累加 C++ include include include include include include include include using na 阅读全文
posted @ 2019-06-10 14:16 AlphaWA 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 要点 反思:以前是在紫书上做过的…… $dp[i][j]$是从1引两条路到达i、j的最大值 为了不相交,则$dp[i][i]$都是非法的,不转移它,也不用它转移 C++ include include include include include include include include i 阅读全文
posted @ 2019-06-07 16:03 AlphaWA 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 要点 序列是n个不同的数,则新学到的一种策略就是二分这个位置的答案,然后可以上下调。 神奇地只关注大于还是小于mid并赋值0、1,这样m个操作的排序就能用线段树维护了! 阅读全文
posted @ 2019-06-07 15:59 AlphaWA 阅读(219) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 27 下一页