C. Dima and Staircase

  • 线段树维护区间最大值。

D. Dima and Two Sequences

  • 由于模数不一定为质数,所以通过拆分质因数来做阶乘取模。

E. Dima and Horses

  • 假设一开始所有人都在一个党派里,如果存在不合法的点则改变点的颜色,改变后颜色后与当前颜色相同的点最多只有一个,则继续判断对应点,显然走过去后不会再走回这条边,所以时间复杂度为\(O(M)\)。

D. Dima and Figure

  • 根据题意,构成的连通块是凸的,考虑一行行放,如果某行的左端点大于上一行的左端点,则后面的行的左端点必须非降,右端点同理。
  • \(dp(i, l, r, s)\)表示前\(i\)行覆盖区间为\([l, r]\)状态为\(s\)的方案数,状态\(s\)表示左右升降情况,转移需要用二维前缀和优化。

Codeforces Round #167 (Div. 1 + Div. 2)的更多相关文章

  1. Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...

  2. Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...

  3. Educational Codeforces Round 43 (Rated for Div. 2)

    Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...

  4. Educational Codeforces Round 35 (Rated for Div. 2)

    Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...

  5. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://cod ...

  6. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://code ...

  7. Educational Codeforces Round 63 (Rated for Div. 2) 题解

    Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进 ...

  8. Educational Codeforces Round 39 (Rated for Div. 2) G

    Educational Codeforces Round 39 (Rated for Div. 2) G 题意: 给一个序列\(a_i(1 <= a_i <= 10^{9}),2 < ...

  9. Educational Codeforces Round 48 (Rated for Div. 2) CD题解

    Educational Codeforces Round 48 (Rated for Div. 2) C. Vasya And The Mushrooms 题目链接:https://codeforce ...

  10. Educational Codeforces Round 60 (Rated for Div. 2) 题解

    Educational Codeforces Round 60 (Rated for Div. 2) 题目链接:https://codeforces.com/contest/1117 A. Best ...

随机推荐

  1. leetcode 235-290 easy

    235. Lowest Common Ancestor of a Binary Search Tree 公共的祖先必定大于左点小于右点,否则不断递归到合适. class Solution { publ ...

  2. go编程资料库

    1.Go语言圣经(中文版)           https://books.studygolang.com/gopl-zh/

  3. 阿里工程师开发了一款免费工具,提升Kubernetes应用开发效率

    对于使用了Kubernetes作为应用运行环境的开发者而言,在同一个集群中我们可以使用命名空间(Namespace)快速创建多套隔离环境,在相同命名空间下,服务间使用Service的内部DNS域名进行 ...

  4. DOM查找元素的方法总结

    按HTML查找:优点:范围可大可小,可设置条件:包括五种方式:1.按id查找:2.按标签名查找:var elems = parent.getElementsByTagName('');3.按name属 ...

  5. node 写的简单爬虫(三)

    异步爬取数据 先引入 var async = require('async'); 然后同样上代码 var topicUrls = [];//存所有地址 http.get(url,function(re ...

  6. bzoj1191 超级英雄

    Description 现在电视台有一种节目叫做超级英雄,大概的流程就是每位选手到台上回答主持人的几个问题,然后根据回答问题的多少获得不同数目的奖品或奖金.主持人问题准备了若干道题目,只有当选手正确回 ...

  7. lower_bounder()和upper_bound()的函数

    lower_bound() .upper_bound()都运用于有序区间的二分查找. ForwardIter lower_bound(ForwardIter first, ForwardIter la ...

  8. 洛谷P3286 [SCOI2014]方伯伯的商场之旅

    题目:洛谷P3286 [SCOI2014]方伯伯的商场之旅 思路 数位DP dalao说这是数位dp水题,果然是我太菜了... 自己是不可能想出来的.这道题在讲课时作为例题,大概听懂了思路,简单复述一 ...

  9. JQ取消hover事件

    $('a').unbind('mouseenter').unbind('mouseleave');

  10. @hdu - 6687@ Rikka with Stable Marriage

    目录 @description@ @solution@ @accepted code@ @details@ @description@ 给定一个稳定婚姻匹配问题,其中第 i 个男生与第 j 个女生之间 ...