Codeforces Round #373 (Div. 1)
Codeforces Round #373 (Div. 1)
A. Efim and Strange Grade
题意
- 给一个长为\(n(n \le 2 \times 10^5)\)的小数,每次可以选择某位小数进行四舍五入,最多做\(t(t \le 10^9)\)次。
- 求最大的数。
思路
- 每次必然找小数部分能进行四舍五入的最高位,并且四舍五入的位置是递增的。
- 注意:99.5这样的数据,最高位会进位。
代码
C. Sasha and Array
题意
- 有\(N(N \le 10^5)\)个数\(a_i(a_i \le 10^9)\),有\(Q(Q \le 10^5)\)次操作,操作分两种:
- 1 l r x,区间[l,r]的值均增加x。
- 2 l r,求\(\sum_{i=l}^{r}{f(a_i)}\),其中\(f(x)\)表示第x项斐波那契数。
思路
- 线段树。
- 斐波那契数可以用矩阵+快速幂求,当区间增量时,显然再乘上\(A^x\)即可。
代码
Codeforces Round #373 (Div. 1)的更多相关文章
- Codeforces Round #373 (Div. 2)A B
Codeforces Round #373 (Div. 2) A. Vitya in the Countryside 这回做的好差啊,a想不到被hack的数据,b又没有想到正确的思维 = = [题目链 ...
- Codeforces Round #373 (Div. 2) C. Efim and Strange Grade 水题
C. Efim and Strange Grade 题目连接: http://codeforces.com/contest/719/problem/C Description Efim just re ...
- Codeforces Round #373 (Div. 2) C. Efim and Strange Grade —— 贪心 + 字符串处理
题目链接:http://codeforces.com/problemset/problem/719/C C. Efim and Strange Grade time limit per test 1 ...
- Codeforces Round #373 (Div. 2)
A,B,C傻逼题,就不说了. E题: #include <iostream> #include <cstdio> #include <cstring> #inclu ...
- Codeforces Round #373 (Div. 2) A B C 水 贪心 模拟(四舍五入进位)
A. Vitya in the Countryside time limit per test 1 second memory limit per test 256 megabytes input s ...
- Codeforces Round #373 (Div. 2) E. Sasha and Array 线段树维护矩阵
E. Sasha and Array 题目连接: http://codeforces.com/contest/719/problem/E Description Sasha has an array ...
- Codeforces Round #373 (Div. 2) B. Anatoly and Cockroaches 水题
B. Anatoly and Cockroaches 题目连接: http://codeforces.com/contest/719/problem/B Description Anatoly liv ...
- Codeforces Round #373 (Div. 2) A. Vitya in the Countryside 水题
A. Vitya in the Countryside 题目连接: http://codeforces.com/contest/719/problem/A Description Every summ ...
- 线段树+矩阵快速幂 Codeforces Round #373 (Div. 2) E
http://codeforces.com/contest/719/problem/E 题目大意:给你一串数组a,a[i]表示第i个斐波那契数列,有如下操作 ①对[l,r]区间+一个val ②求出[l ...
随机推荐
- WP8.1 Study2:MapControl控件的应用
总的界面布局如下:
- 戴文的Linux内核专题:08内核配置(5)
转自Linux中国 Linux内核拥有许多可以配置的特性,接下来我们还有许多要配置. 下一个可以配置的特性是x86的随机数生成器(x86 architectural random number gen ...
- Memcache 详解
这里收集了经常被问到的关于memcached的问题 一般的问题 什么是memcached? 从哪获得memcached? 怎么安装memcached? 哪些平台可以运行memcached? 什么情况下 ...
- 关于强制类型转换(c语言)
因为今天看的代码中用到了结构体的强制类型转换,就很想了解一下结构体的强制类型转换是怎样的. 一个结构体如下: 在下面这段代码中rbuf->reqCmdBuf是一个空指针,首先将这个空指针赋值给一 ...
- Bootstrap非常简单实用的web前端开发框架
今天无意间用firebug看网站的代码发现了Bootstrap,之前从来没有听说过这个东东,于是对它产生了好奇感,通过百度我了解到了Bootstrap是一款非常简单,强悍,实用,移动设备端优先使用的这 ...
- MJPhotoBrowser 两个bug:回到小图模式时会闪动&大图太靠近底部
最近项目需要写网络的相片视频浏览的库, 没时间重写,使用了MJPhotoBrowser,里面的一些bug 和解决写在下面 1.-[MJPhotoLoadingView setProgress:]: m ...
- EF 学习笔记
1.EFcodeFirst如何使用存储过程!public string GetCoupon(int type) { using (var db=new ProbabilityContext()) { ...
- 进行以上Java编译的时候,出现unmappable character for encoding GBK。
public class Exerc02{ public static void main(String args []){ char c = '中国人'; System.out.pingtln(c) ...
- linux命令:touch
1:命令介绍: touch用来创建文件或修改文件和目录的时间戳,包括存取时间和更改时间. 2:命令格式: touch [选项] 文件 3:命令参数: -a 或--time=atime或--time ...
- 爆破unabexcm5fl(已补上注册机)
系统 : Windows xp 程序 : unabexcm5fl 程序下载地址 :http://pan.baidu.com/s/1pJYaNUV 要求 : 爆破 使用工具 :OD 可在“PEDIY C ...