寒假集训.Discrete-Function
2015-02-01 12:51
260 查看
Discrete Function
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
There is a discrete function. It is specified for integer arguments from 1 to N (2 ≤ N ≤ 100000). Each value of the function is longint (signed long in C++). You have to find such two points of the function
for which all points between them are below than straight line connecting them and inclination of this straight line is the largest.
Input
There is an N in the first line. Than N lines follow with the values of the function for the arguments 1, 2, …, N respectively.
Output
A pair of integers, which are abscissas of the desired points, should be written into one line of output. The first number must be less then the second one. If it is any ambiguity your program should write the pair with the smallest
first number.
Sample Input
数组一开始开的不够大Runtime error (access violation)了。
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
There is a discrete function. It is specified for integer arguments from 1 to N (2 ≤ N ≤ 100000). Each value of the function is longint (signed long in C++). You have to find such two points of the function
for which all points between them are below than straight line connecting them and inclination of this straight line is the largest.
Input
There is an N in the first line. Than N lines follow with the values of the function for the arguments 1, 2, …, N respectively.
Output
A pair of integers, which are abscissas of the desired points, should be written into one line of output. The first number must be less then the second one. If it is any ambiguity your program should write the pair with the smallest
first number.
Sample Input
input | output |
---|---|
3 2 6 4 | 1 2 |
相关文章推荐
- HDU-2089 不要62 寒假集训1 08
- SDUT_2015寒假集训_结构体练习_B-选夫婿1
- 2013寒假练习 1055 The Euler function
- 寒假集训个人赛 A
- 2018寒假集训-紫皮书-全排列
- 纪中寒假集训1.18总结
- (寒假集训) 不等数列
- 寒假集训日常!
- 2017.1.13——寒假集训第二天
- 2017寒假集训-小题训练1:B - Indivisibility
- 寒假集训bfs 模板题2,逃离迷宫
- 寒假集训2 I 二分 hdu 5178
- SDUT_2015寒假集训_结构体练习_C-分类游戏
- SDUT14级寒假集训-找女朋友- 快排
- 2015年寒假集训专题--- 数据结构实验之栈:行编辑器
- 2015年14级寒假集训--素数筛
- 寒假集训附加题目题解报告(2)——加减乘除
- 寒假集训作业(1)——结构体
- 寒假集训个人赛 D
- 寒假集训最小生成树专题