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-05-16 03:44:08
#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cmath>

using namespace std;

// Headers
string toString (double);
int toInt (string);
double toDouble (string);

int main() {
int n, i, max, s;
int a[100];

max = (int) (-99999999);
s = 0;
cin >> n;
for (i = 1; i <= n; i++) {
cin >> a[i];
if (a[i] > max) {
max = a[i];
s = i;
}
}
cout << max;
cout << " ";
cout << s << endl;
return 0;
}

// The following implements type conversion functions.
string toString (double value) { //int also
stringstream temp;
temp << value;
return temp.str();
}

int toInt (string text) {
return atoi(text.c_str());
}

double toDouble (string text) {
return atof(text.c_str());
}
amraad zriulv gs xaxaxa
2024-05-09 04:52:15
#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cmath>

using namespace std;

// Headers
string toString (double);
int toInt (string);
double toDouble (string);

int main() {
int n, i, max, s;
int a[100];

max = (int) (-99999999);
s = 0;
cin >> n;
for (i = 1; i <= n; i++) {
cin >> a[i];
if (a[i] > max) {
max = a[i];
s = i;
}
}
cout << max;
cout << " ";
cout << s << endl;
return 0;
}

// The following implements type conversion functions.
string toString (double value) { //int also
stringstream temp;
temp << value;
return temp.str();
}

int toInt (string text) {
return atoi(text.c_str());
}

double toDouble (string text) {
return atof(text.c_str());
}
2024-05-07 04:22:53
purvee lets meet at ulaanbaatar i will wait for you ;)
2024-05-03 03:29:33
enkhmend mundag smart
2024-05-03 03:29:19
hosoo tneg
2024-05-02 05:40:22
xoxo
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
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.