A - Circle Metro

模拟几百步就可以了。

B - Pairs

爆搜一下,时间复杂度大概是 $O(4 * n)$

Code: 56306723

C - Increasing by Modulo

二分答案,然后验证一下就好了,第一个数越小越好,之后的数都要求和前一个相等或者大一点。复杂度 $n * log(n)$

D - Good Triple

对于每一个 $i$,需要计算出最小的 $x$,使得 $s[i-x] = s[x] = s[i + x]$,对于 $i$ 而言,如果区间左端点在 $[1, i - x]$ 且右端点在 $[i + x, n]$,这样的区间就是合法区间。

处理出每一个合法区间集合:左端点在 $[1, i - x]$ 且右端点在 $[i + x, n]$,最后的工作就是去重,计算有多少种不同的区间。这个可以用矩形面积并来解决,不赘述。

这题的复杂度我不太会计算,第一步我是暴力算出来的,看似 $O(n^2)$ 的操作,结果好像很快就跑过去了。

Code:56313123

E - And Reachability

这题是比较标准的有向无环图上的 dp 题。

处理出 $dp[i][j]$ 表示第 $i$ 个位置的数字往后走,走到二进制第 $j$ 为是 $1$ 的离 $i$ 最近位置。

如果知道了 $dp[i][j]$,那么我们可以枚举最后一步如何跳到位置 $y$,必然是枚举 $y$ 的二进制的中的 $1$。

复杂度:$O(n*logn*logn)$

Code:56545084

[Done] Codeforces Round #562 (Div. 2) 题解的更多相关文章

  1. Codeforces Round #182 (Div. 1)题解【ABCD】

    Codeforces Round #182 (Div. 1)题解 A题:Yaroslav and Sequence1 题意: 给你\(2*n+1\)个元素,你每次可以进行无数种操作,每次操作必须选择其 ...

  2. Codeforces Round #608 (Div. 2) 题解

    目录 Codeforces Round #608 (Div. 2) 题解 前言 A. Suits 题意 做法 程序 B. Blocks 题意 做法 程序 C. Shawarma Tent 题意 做法 ...

  3. Codeforces Round #525 (Div. 2)题解

    Codeforces Round #525 (Div. 2)题解 题解 CF1088A [Ehab and another construction problem] 依据题意枚举即可 # inclu ...

  4. Codeforces Round #528 (Div. 2)题解

    Codeforces Round #528 (Div. 2)题解 A. Right-Left Cipher 很明显这道题按题意逆序解码即可 Code: # include <bits/stdc+ ...

  5. Codeforces Round #466 (Div. 2) 题解940A 940B 940C 940D 940E 940F

    Codeforces Round #466 (Div. 2) 题解 A.Points on the line 题目大意: 给你一个数列,定义数列的权值为最大值减去最小值,问最少删除几个数,使得数列的权 ...

  6. Codeforces Round #677 (Div. 3) 题解

    Codeforces Round #677 (Div. 3) 题解 A. Boring Apartments 题目 题解 简单签到题,直接数,小于这个数的\(+10\). 代码 #include &l ...

  7. Codeforces Round #665 (Div. 2) 题解

    Codeforces Round #665 (Div. 2) 题解 写得有点晚了,估计都官方题解看完切掉了,没人看我的了qaq. 目录 Codeforces Round #665 (Div. 2) 题 ...

  8. Codeforces Round #160 (Div. 1) 题解【ABCD】

    Codeforces Round #160 (Div. 1) A - Maxim and Discounts 题意 给你n个折扣,m个物品,每个折扣都可以使用无限次,每次你使用第i个折扣的时候,你必须 ...

  9. Codeforces Round #383 (Div. 2) 题解【ABCDE】

    Codeforces Round #383 (Div. 2) A. Arpa's hard exam and Mehrdad's naive cheat 题意 求1378^n mod 10 题解 直接 ...

随机推荐

  1. Java IO系统--RandomAccessFile

    RandomAccessFile 实现了DataOutput接口和DataInput接口.父类是Object,不继承任何的InputStream和OutStram. public class Rand ...

  2. CMD命令打包文件夹成jar

    网上的很多例子都是直接将在dos界面下输入jar命令出现的帮助信息给贴上了.不明白的人根本看不懂.当然我也看不懂,好在自己试了好多遍,终于成功了.现在我就根据我刚刚的操作来说明一下. 我介绍的是将一个 ...

  3. svn服务端搭建

    本文介绍的是SVN的服务器端的搭建. 一.SVN服务器安装 1.     首先来下载和搭建SVN服务器,下载地址如下: http://subversion.apache.org/packages.ht ...

  4. python哲学

    import this The Zen of Python, by Tim Peters # python的设计哲学, 作者:Tim Peters Beautiful is better than u ...

  5. VS2010/VS2012/VS2015下openGL环境配置(转)

    按:按照下述博文,三个例子均成功. https://blog.csdn.net/so_geili/article/details/51685005 请仔细阅读每一个字. 为了学习<OpenGL超 ...

  6. LeetCode_349. Intersection of Two Arrays

    349. Intersection of Two Arrays Easy Given two arrays, write a function to compute their intersectio ...

  7. iOS实现简单时钟效果

    实现的效果图如下 : 实现代码如下: #import "ViewController.h" //将旋转角度转换为弧度制#define angleToRadion(angle) (( ...

  8. 【Leetcode_easy】929. Unique Email Addresses

    problem 929. Unique Email Addresses solution: class Solution { public: int numUniqueEmails(vector< ...

  9. npm 全局安装路径 在哪里

    注意:在Admin下,需要把隐藏文件显示出来,才能找到对应的文件路径.

  10. 基于 Egg.js 框架的 Node.js 服务构建之用户管理设计

    前言 近来公司需要构建一套 EMM(Enterprise Mobility Management)的管理平台,就这种面向企业的应用管理本身需要考虑的需求是十分复杂的,技术层面管理端和服务端构建是架构核 ...