BestCoder Round #64 (div.2) 1002 Sum HDU 5586 联机算法
来源:互联网 发布:如何成为网络作家 编辑:程序博客网 时间:2024/05/20 06:25
Sum
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 113 Accepted Submission(s): 74
Problem Description
There is a number sequence A1,A2....An ,you can select a interval [l,r] or not,all the numbers Ai(l≤i≤r) will become f(Ai) .f(x)=(1890x+143)mod10007 .After that,the sum of n numbers should be as much as possible.What is the maximum sum?
Input
There are multiple test cases.
First line of each case contains a single integer n.(1≤n≤105)
Next line contains n integersA1,A2....An .(0≤Ai≤104)
It's guaranteed that∑n≤106 .
First line of each case contains a single integer n.
Next line contains n integers
It's guaranteed that
Output
For each test case,output the answer in a line.
Sample Input
210000 999951 9999 1 9999 1
Sample Output
1999922033
Source
BestCoder Round #64 (div.2)
出题人:令Ai=f(Ai)−Ai,然后求一遍最大连续子序列和就能知道最多能增加的值。
联机算法 :
0 0
- BestCoder Round #64 (div.2) 1002 Sum HDU 5586 联机算法
- BestCoder Round #64 (div.2) B Sum&&HDU 5586
- BestCoder Round #64 (div.2) Sum
- HDU 5586 Sum(最大连续子序列和)——BestCoder Round #64(div.1 div.2)
- BestCoder Round #64 (div.2) HDOJ5586 Sum(脑洞)
- BestCoder Round #64 (div.1) A.Sum
- BestCoder Round #64 (div.2)
- BestCoder Round #64 (div.2)
- BestCoder Round #54 (div.2) HDU 5428 The Factor(1002)
- hdu 5495 BestCoder Round #58 (div.2) 1002
- HDU 5671 Matrix (BestCoder Round #81 (div.2) 1002)
- BestCoder Round #64 (div.2) 1001 Numbers HDU 5585 模拟
- BestCoder Round #64 (div.2) A Numbers&&HDU 5585
- BestCoder Round #64 (div.2) 1003 Array HDU 5587
- 【HDU】BestCoder Round #11 (Div. 2)
- hdu 5600 BestCoder Round #67 (div.2)
- hdu 5637 BestCoder Round #74 (div.2)
- BestCoder Round #64 Sum
- web进门第14天
- 【线性代数公开课MIT Linear Algebra】 第二十四课 特征值与特征向量的应用——马尔科夫矩阵、傅里叶级数
- UVa 11721 Instant View of Big Bang
- BMFont _Assistant 生成位图字体/动态字体的辅助脚本
- ip_queue和libcrypto实现另一种VPN
- BestCoder Round #64 (div.2) 1002 Sum HDU 5586 联机算法
- Android5.0新特性
- POJ 2773 Happy 2006(容斥原理)
- POJ 2155 Matrix
- Android平台多国语的语言以及国家的代码参考
- 【伸展树】[CQBZOJ2803]普通平衡树splay top_down模板
- 【南大软院大神养成计划:第十二天&第十三天】JS,进阶的巨人(二)
- C语言开发总结(十六)
- 关于OA系统ie8上传附件无法正常显示的问题