Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7507 - Массивын их нь хэд дэх

Өгөгдсөн нэг хэмжээст бүхэл тоон массивын хамгийн их элемент хэд дэх нь вэ? Хэрэв хамгийн их элемент 1-ээс их бол бага дугаарыг нь хэвлэнэ.

Input

Эхний мөрөнд массивын элементийн тоо өгөгдөнө. n<=100.

Хоёр дахь мөрөнд массивын элементүүд зайгаар тусгаарлагдан өгөгдөнө.

Output

Массивын хамгийн их элемент, дугаарын хамт зайгаар тусгаарлагдан нэг мөрөнд хэвлэгдэнэ. 

Example

Input:
5
9 10 8 10 6

Output:
10 2

Нэмсэн:Bataa
Огноо:2013-01-15
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2019-10-27 06:37:22
lol

Last edit: 2019-10-27 06:37:40
2019-10-23 09:41:58
#include <bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c=-10000000,d = 0,x[100];
cin>>a;
for(int i=1;i<=a;i++){
cin>>x[i];
if(x[i]>c){
c=x[i];
d = i;
}
}
cout<<c<<" "<<d;
}
2019-10-01 08:36:09
#include <iostream>
using namespace std;


int main(){
int n,c;
cin>>n;
int ar[n];
c=0;
while(c<n){
cin>>ar[c];
c=c+1;
}
c=0;
int max=ar[0],d=0;

while(c<n){
if(max<ar[c]){
max=ar[c];
d=c;
}
c=c+1;
}

cout<<max<<" "<<d+1;
}
2019-09-30 03:00:24
#include<iostream>
using namespace std;
int main(){
int a,c=0,d=0,l;
cin>>a;
int b[a];
while(a>c){
cin>>b[c];
if(d<b[c]){
d=b[c];
l=c;
}
c++;
}
cout<<d<<" "<<l+1;
}
2019-04-08 04:12:46
#include <bits/stdc++.h>
using namespace std;

int main()
{
int a[1000];
int d,i,j,n,max,t;
scanf("%d",&n);

for (i=1; i<=n; i++)
cin>>a[i];
max=a[1]; d=1;
for (i=2; i<=n; i++)
if(max<a[i])
{
max=a[i];
d=i;
}
printf("%d %d",max,d);
return 0;
}
odna
2019-03-14 04:51:50
#include <bits/stdc++.h>
using namespace std;
int a[1000];
int d,i,j,n,m,t;
int main()
{
scanf("%d",&n);

for (i=1; i<=n; i++)
cin>>a[i];
m=a[i]; d=1;
for (i=0; i<=n; i++)
if(m>a[i]) m=a[i],d=i;

t=0;
for (i=0; i<=n; i++)
if(m<a[i]) m=a[i],d=i;
printf("%d %d",m,d);
return 0;
}
2019-03-14 04:14:57
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;
int n,m,i,j,a[10000],s,k,p,l;
int main(){
scanf("%d",&n);
for (i=1;i<=n;i++)
scanf("%d",&a[i]);

s=-10000;
for (j=1;j<=n;j++)
if (a[j]>s) { s=a[j]; l=j;}

printf("%d %d",s,l);
system("pause");
return 0;}
2019-02-19 08:08:23


















































































































































































































































































































































































































































































































































































































2019-01-31 10:52:24
#include <stdio.h>
#include <stdlib.h>
int main()
{
int max,n,d,i;
int a[100];
scanf ("%d",&n);
for (i=1; i<=n; i++)
scanf ("%d",&a[i]);
max=a[1];
d=1;
for (i=2; i<=n; i++)
if (a[i]>max)
{
max=a[i];
d=i;
}
printf ("%d %d",max,d);
system ("pause");
return 0;
}
2018-12-05 10:10:58
hudlaa hariut ywuulhaa bolioch
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.