A. Little elephant and Rozdil

Source: Internet
Author: User
Time limit per test

2 seconds

Memory limit per test

256 megabytes

Input

Standard Input

Output

Standard output

The little elephant loves Ukraine very much. Most of all he loves town rozdol (UKR. "Rozdil ").

However, Rozdil is dangerous to settle, so the little elephant wants to go to some other town. the little elephant doesn't like to spend much time on traveling, so for his journey he will choose a town that needs minimum time to travel. if there are multiple
Such cities, then the little elephant won't go anywhere.

For each town branch t for Rozdil you know the time needed to travel to this town. Find the town the little elephant will go to or print "still Rozdil ",
If he stays in Rozdil.

Input

The first line contains a single integerN(1 digit ≤ DigitNLimit ≤ limit 105 )-
The number of cities. The next line containsNIntegers, separated by single spaces:I-Th
Integer represents the time needed to go from town Rozdil toI-Th Town. The time values are positive integers, not exceeding 109.

You can consider the cities numbered from 1N,
Specified Sive. Rozdil is not among the numbered cities.

Output

Print the answer on a single line-the number of the town the little elephant will go to. If there are multiple cities with minimum travel time, print "still
Rozdil "(without the quotes ).

Sample test (s) Input
27 4
Output
2
Input
77 4 47 100 4 9 12
Output
Still Rozdil
Note

In the first sample there are only two cities where the little elephant can go. The travel time for the first town equals 7, to the second one-4.
The town which is closest to rodzil (the only one) is the second one, so the answer is 2.

In the second sample the closest cities are cities two and five, the traveling time to both of them equals 4, so the answer is "still
Rozdil ".

Explanation: This is to judge whether there are multiple smallest numbers in a column.

#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>#include<cmath>using namespace std;double a[300001];int main(){int n,i;double min;int pos;int flag;scanf("%d",&n);for(i=0;i<n;i++){scanf("%lf", &a[i]);}flag=0;min=a[0];pos=1;for(i=1;i<n;i++){if(a[i]<min){flag=0;min=a[i];pos=i+1;}else if(a[i]==min){flag=1;}}if(flag==1){printf("Still Rozdil\n");}else{printf("%d\n",pos);}return 0;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.