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-07-02 10:22:35
#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;
}

MEN JAZDM
2024-07-02 10:05:31
Берілген бір өлшемді бүтін сандар массивінің ең үлкен элементі қандай? Ең үлкен элемент 1-ден үлкен болса, төменгі сан басып шығарылады.
2024-07-02 10:04:50
Бірінші жол массивтегі элементтердің санын қамтиды. n<=100.

Екінші жолда массив элементтері бос орындармен бөлінген.
2024-06-03 07:37:34
WTF #include <stdio.h>

int main() {
int n, max = 0, maxIndex = 0;

scanf("%d", &n);

int arr[n];
for(int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
if (arr[i] > max) {
max = arr[i];
maxIndex = i + 1;
}
}


printf("%d %d\n", max, maxIndex);

return 0;
}
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
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.