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
2024-04-29 10:41:55
andur llra

2024-03-05 08:02:02
cristiano ronaldo ygd iim hog yumbe
2023-10-21 05:08:09
ene bol mash sonin bodlogo
2023-09-29 02:37:57
Erkhes tiim ym bainelee iim ym bainelee goyim bainenalee
2023-07-02 12:48:47
#include <bits/stdc++.h>
using namespace std;

int main() {



long long a[1000],b=0,n,i,r,e,c,s=0,d=-132423;
cin>>n;

for(i=1; i<=n; i++){
cin>>a[i];
if(a[i]>d)
d=a[i];
}

for(b=n; b>0; b--){
if(a[b]==d){
s=b;

}
}


cout<<d<<' '<<s;
return 0;
}
ahiiha ig dagaarai (kapteemo)

Last edit: 2023-07-02 12:58:17
2023-05-25 04:05:35
Give me the answer right now or i will do unholy thing to your as$h0l3 with my snake at 3 am
2023-03-04 09:17:19
stfu bitch
2023-02-28 01:37:52
wth yj bdhiin beeeeee?????
2023-02-02 16:24:11
// Online C++ compiler to run C++ program online
#include <iostream>
using namespace std;
int main() {
int a;
cin>>a;
int arr[a];
int max=-100;
for(int i=0;i<a;i++){
cin>>arr[i];
if(max<arr[i]){
max=arr[i];
}
}
cout<<max<<" ";
for(int i=0;i<a;i++){
if(max==arr[i]){
i=i+1;
cout<<i;
break;
}
}
return 0;
}
//qcc8.3 gedeg ni shuu
2022-12-01 02:08:56
#include<stdio.h>
main()
{
int n,i,a[101],s,m;
scanf("%d",&n);

for(i=1;i<=n;i++)
scanf("%d",&a[i]);
m=a[1];
s=1;
for(i=2;i<=n;i++)
if(a[i]>m) {m=a[i]; s=i;}

printf("%d %d\n",m,s);
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.