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 ...
随机推荐
- Android 查看webview里面的图片
今天介绍一下怎么查看WebView里面的图片,首先要设置WebView能够支持JavaScript,然后实现JavaScript的监听接口: mWebView.getSettings().setJav ...
- vs2012 .netFramwork2.0发布到xp
开发环境 windows server2008R2 VS2012 .net Framwork2.0 开发的winform程序 在有的xp系统下不能运行 选择 项目属性=>编译 Build=&g ...
- FZU1683 矩阵
//Accepted 220 KB 359 ms #include <cstdio> #include <cstring> ; int pp; struct matrix { ...
- 显示pdf
document.all[document.all.PDFNotKnown ? "IfNoAcrobat" : "IfAcrobat"].style.displ ...
- Canopy v. 1.5.5 ubuntu安装流程
官网的下载超级慢,还总是断,一断就失败了 我花费了7个小时终于在尝试了5次以后下载成功了,现在将网盘链接分享出来 https://yunpan.cn/cxt28gM26mxQU 访问密码 301d ...
- python 中的json解析库
当一个json 数据很大的时候.load起来是很耗时的.python中常见的json解析库有cjson,simplesjson,json, 初步比较了一下, 对于loads来讲 simplejson ...
- Spring MVC配置文件解释
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...
- php大力力 [024节]PHP中的字符串连接操作(2015-08-27)
2015-08-27 php大力力024.PHP中的字符串连接操作 PHP中的字符串连接操作 阅读:次 时间:2012-03-25 PHP字符串的连接的简单实例 时间:2013-12-30 很多 ...
- Linux在IA-32体系结构下的地址映射
1.概览 2.逻辑地址到线性地址 逻辑地址到线性地址的映射在IA-32体系结构中又被称为段式映射.如上图所示,段式映射我们首先需要获取逻辑地址和段选择符,段选择符用于获取GDT中段的基地址,将逻辑地址 ...
- 顺序表(C++)
以下为数据结构中的顺序表实现代码,已测试能够运行.虽然说是C++版的,但是其实应该是C语言班的.C++应该是面向对象,用抽象方法实现,而以下代码是面向过程的,只是把C语言中的输入(scanf)和输出( ...