P4744 A ' s problem (a)Time: 1000ms/Space: 655360kib/java class name: main background
Winter School Entrance test, every three days to settle the results. Participate in benefits
Describe
This is a subject of background, small A is also a person with a story. But unfortunately the paper is too small, small a can not tell the story in detail to everyone. Maybe small a himself also can not tell his own story, because if it is clear, there is no such a problem ...
The problem with small A is this, it found n different jobs, I work every month to have AI wages, each job needs a small a 8 hours a day, work 7 days a week. Little A would like to know the number of jobs with the highest cost performance (one months ' wages divided by the total length). If there are multiple copies, the output number is the smallest.
Input format
The first row is a number n, which indicates that there is n job.
The next n number represents AI.
Output format
Output a number to indicate the answer.
Note
Input sample
5
3 3 4) 5 5
Output sample
4
Data range
For data n<=100,1<=ai<=1000 of 100%.
Because each job looks and so on, so cost-effective = wages/hours only see wages. So this method is the first to find the largest number in the past
#include <cstdio>using namespacestd;intn,maxn,ans,x;intMain () {scanf ("%d",&N); for(intI=1; i<=n;i++) {scanf ("%d",&x); if(x>MAXN) {MAXN=x; Ans=i; }} printf ("%d", ans); return 0;}
Ching North Academy 2017NOIP Winter School Entrance Test P4744 a ' s problem (a)