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. idea给web项目添加tomcat

    首先,你需要新建一个web项目 生成这个样子: 我们可以新建lib文件夹用来装载必要jar,和新建classess文件夹用来存储编译后文件,这样感觉和myeclipes的项目相似. 进入项目设置,修改 ...

  2. Android 导入jar包 so模块--导入放置的目录

    Android视图下 app目录下的jniLibs 对应Project 视图app下的libs目录 把jar包或者带so文件的文件夹(一般以处理器型号命名如:arbeabi  arm64-v8a)复制 ...

  3. Javascript 基础(一)

    一.Js命名规范(变量/函数) (1)使用大小写字母,数字,_ ,$ 可以命名 (2)不能以数字打头 (3)不能使用js的关键字/保留字 (4)区分大小写 (5)单行注释 //多行注释 二.js的数据 ...

  4. Mainstoryboard

    页面间进行跳转 [self performSegueWithIdentifier:@"signInSuccess" sender:self] signSuccess是miansto ...

  5. hello world Firmware Library

    其实正点原子有良好的模板工程...user .lab文件 ,obj. 一脸蒙的是库函数的操作方式.... 为了便于管理,该项目文件夹内,我分了以下几个文件夹:"PROJ"存放工程文 ...

  6. list.clear()和list=null的区别

    以前并没有注意到list.clear()和list=null的区别,其实,区别在于 clear()方法是将list清空,但是对象的引用还在,只不过是一个表现为空引用 list=null是将list对象 ...

  7. resolve some fragment exception

    1.android fragment not attached to activity http://blog.csdn.net/walker02/article/details/7995407 if ...

  8. android自动化测试解决跨进程通信问题

    大概用这些吧: IPC  Handler    Messager   Bundle  service(binder)   messageconnection ,thead.getXXX.getId 注 ...

  9. PHP中的文件系统处理(一)

    PHP文件系统处理     所有文件处理都是使用系统函数完成的.     是基于Linux/Unix系统为模型        文件系统处理的作用:           1. 所有的项目离不开文件处理  ...

  10. Palindrome Number ---- LeetCode 009

    Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negativ ...