Codeforces Round #129 (Div. 2)
A. Little Elephant and Rozdil
- 求\(n\)个数中最小值的个数及下标。
B. Little Elephant and Sorting
- \[\sum_{i=1}^{n-1}{max(0, a_i-a_{i+ 1})}\]
C. Little Elephant and Interval
- 问题转化成求\([1,n]\)范围内满足题意的数的个数。
- 假设\(n\)的位数为\(L\),当\(L \gt 2\)时,若\(x\)的位数小于\(L\),则除了首位和末位以外,其余位任意取值,即\(9\cdot 10^{i - 2}\)。
若\(x\)的位数等于\(L\),那么考虑首位与\(n\)的首位大小关系,小于的情况下后面位任意取,相等情况下需要考虑\(n\)末位与首位的大小关系。
D. Little Elephant and Cards
- 对颜色离散化后,统计每种颜色正面个数以及背面个数。
- 注意正面颜色和背面颜色可能相同。
E. Little Elephant and Furik and Rubik
- 假设\(a_i=b_j\),那么这对的贡献为\(min(i,j)*min(n-i+1, n-j+1)\)。
- 如果固定住位置\(i\),将\(j\)分成小于\(i\)和大于等于\(i\)两部分,就可以统计出\(i\)的所有贡献。
Codeforces Round #129 (Div. 2)的更多相关文章
- 字符串(后缀自动机):Codeforces Round #129 (Div. 1) E.Little Elephant and Strings
E. Little Elephant and Strings time limit per test 3 seconds memory limit per test 256 megabytes inp ...
- Codeforces Round #129 (Div. 1)E. Little Elephant and Strings
题意:有n个串,询问每个串有多少子串在n个串中出现了至少k次. 题解:sam,每个节点开一个set维护该节点的字符串有哪几个串,启发式合并set,然后在sam上走一遍该串,对于每个可行的串,所有的fa ...
- Codeforces Round #129 (Div. 2) C
Description The Little Elephant very much loves sums on intervals. This time he has a pair of intege ...
- Codeforces Round #129 (Div. 2) B
Description The Little Elephant loves sortings. He has an array a consisting of n integers. Let's nu ...
- Codeforces Round #129 (Div. 2) A
Description The Little Elephant loves Ukraine very much. Most of all he loves town Rozdol (ukr. &quo ...
- Educational Codeforces Round 129 (Rated for Div. 2) A-D
Educational Codeforces Round 129 (Rated for Div. 2) A-D A 题目 https://codeforces.com/contest/1681/pro ...
- Codeforces Round #366 (Div. 2) ABC
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...
- Codeforces Round #354 (Div. 2) ABCD
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/out ...
- Codeforces Round #368 (Div. 2)
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...
随机推荐
- python遍历文件夹下的文件
在读文件的时候往往需要遍历文件夹,python的os.path包含了很多文件.文件夹操作的方法.下面列出: os.path.abspath(path) #返回绝对路径 os.path.basename ...
- 最好的Java IDE之争:Eclipse PK IntelliJ IDEA
话说,好马配好鞍,一个好的工匠,必定要有一套好的工具才能打造出最好的工艺给大家.之前,Plumbr团队里的所有成员都使用Eclipse编辑器,而如今,大家都成为IntelliJ IDEA用户.那么,到 ...
- SharePoint 2013 开发——发布SharePoint应用程序
博客地址:http://blog.csdn.net/FoxDave 前几篇我们介绍了开发.部署和调试SharePoint应用程序的基础,本篇介绍更实用的操作,当我们开发一个SharePoint应用 ...
- 发布Restful服务时出现IIS 指定了身份验证方案错误时的解决方案(IIS specified authentication schemes)
发布RESTful服务,当访问.svc文件时出现如下错误时: IIS 指定了身份验证方案“IntegratedWindowsAuthentication, Anonymous”,但绑定仅支持一种身份验 ...
- stm32 dac 配置过程
DAC模块的通道1来输出模拟电压,其详细设置步骤如下: 1)开启PA口时钟,设置PA4为模拟输入. STM32F103ZET6的DAC通道1是接在PA4上的,所以,我们先要使能PORTA的时钟,然后设 ...
- PHP图像处理之画图
PHP图像处理 画图 验证码,统计图 安装GD库-----LAMP 安装后在D:\APMServ5.2.6\PHP\ext文件中有php_gd2.dll文件 ...
- 作业3-个人项目<词频统计>
上了一天的课,现在终于可以静下来更新我的博客了. 越来越发现,写博客是一种享受.来看看这次小林老师的“作战任务”. 词频统计 单词: 包含有4个或4个以上的字 ...
- iOS log第三方库之间的对比
- VMware与Cisco etherchannel
命令样例: ①把要绑定team的端口添加到channel-group interface Te2/1/1 switchport switchport access vlan 123 switchpor ...
- 9、网页制作Dreamweaver(jQuery基础:事件)
事件 定义 即当HTML中发生某些事(点击.鼠标移过等)的时候调用的方法 $(selector).action() 触发 事件的触发有两种方法: 1.直接将事件click写在<javascrip ...