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. 1 l r x,区间[l,r]的值均增加x。
  2. 2 l r,求\(\sum_{i=l}^{r}{f(a_i)}\),其中\(f(x)\)表示第x项斐波那契数。

思路

  • 线段树。
  • 斐波那契数可以用矩阵+快速幂求,当区间增量时,显然再乘上\(A^x\)即可。

代码

Codeforces Round #373 (Div. 1)的更多相关文章

  1. Codeforces Round #373 (Div. 2)A B

    Codeforces Round #373 (Div. 2) A. Vitya in the Countryside 这回做的好差啊,a想不到被hack的数据,b又没有想到正确的思维 = = [题目链 ...

  2. 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 ...

  3. 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 ...

  4. Codeforces Round #373 (Div. 2)

    A,B,C傻逼题,就不说了. E题: #include <iostream> #include <cstdio> #include <cstring> #inclu ...

  5. 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 ...

  6. 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 ...

  7. Codeforces Round #373 (Div. 2) B. Anatoly and Cockroaches 水题

    B. Anatoly and Cockroaches 题目连接: http://codeforces.com/contest/719/problem/B Description Anatoly liv ...

  8. 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 ...

  9. 线段树+矩阵快速幂 Codeforces Round #373 (Div. 2) E

    http://codeforces.com/contest/719/problem/E 题目大意:给你一串数组a,a[i]表示第i个斐波那契数列,有如下操作 ①对[l,r]区间+一个val ②求出[l ...

随机推荐

  1. python框架(flask/django/tornado)比较

    一.对外数据接口 三者作为web框架,都是通过url映射对外的接口 flask:以decorator的形式,映射到函数中 django:以字典形式,映射到函数 tornado: 以字典形式,映射到类中 ...

  2. UITextView实现图文混排效果

    用UITextView实现图文混排效果的展示,首先要禁用UITextView的编辑功能,将属性editable设置为NO 1.首先创建一个NSTextAttachment对象,这个对象有一个image ...

  3. Struts2 validate校验

    一般的,用户注册的时候,我们需要校验一些用户提交过来的参数. 一般有两道屏障,一是在前台页面上使用js进行验证,直接杜绝了不正常信息的提交.二是将提交过来的信息进行验证,不通过则返回注册页面并显示错误 ...

  4. HDU 1114 Piggy-Bank (poj1384)

    储钱罐 [题目描述] 今年的ACM比赛在xxx国举行,为了比赛的顺利进行,必须提前预算好需要的费用,以及费用的来源.费用的主要来源是只进不出的金钱.其实原理很简单,每当ACM成员有任何一点小钱,他们就 ...

  5. App右上角数字

    IOS7: UIApplication *app = [UIApplication sharedApplication]; // 应用程序右上角数字 app.applicationIconBadgeN ...

  6. (转)JS浮动窗口(随浏览器滚动而滚动)

    原文:http://hi.baidu.com/aiyayaztt/item/4201c55a6b729dced2e10c79 JS浮动窗口(随浏览器滚动而滚动) 往往用于一些联系方式,互动平台模块,随 ...

  7. mantis增加密码修改

    解决方式就是考虑修改Mantisbt PHP程序,增加一个密码修改框,这样管理员就可以直接修改用户密码了.     操作步骤如下:    1) 修改文件 manage_user_edit_page.p ...

  8. cout 计算顺序问题

    cout输出流的执行顺序   下面是IBM的一道笔试题 #include <iostream> using namespace std; int fun( ) { cout << ...

  9. BUY LOW, BUY LOWER_最长下降子序列

    Description The advice to "buy low" is half the formula to success in the bovine stock mar ...

  10. Magento中如何调用SQL语句

    I. 创建表结构和测试数据 create table rooms(id int not null auto_increment, name varchar(100), primary key(id)) ...