码迷,mamicode.com
首页 > 其他好文 > 详细

寒假集训.Discrete-Function

时间:2015-02-01 13:32:42      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:c++   acm   oj   

Discrete Function
Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u

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
数组一开始开的不够大Runtime error (access violation)了。

寒假集训.Discrete-Function

标签:c++   acm   oj   

原文地址:http://blog.csdn.net/a576699534/article/details/43370973

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!