toiyeuuit
NguyenAnhQuan
c_cpp
a month ago
560 B
4
Indexable
Never
#include <bits/stdc++.h> #define ll long long #define LIM 1000005 #define X first #define Y second #define EL cout<<"\n" using namespace std; int a[LIM]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; int mx = *(a+1); for (int i = 2; i <= n; i++) mx = max(mx, *(a+i)); int cnt = 0; for (int i = 1; i <= n; i++) if (mx == *(a+i)) cnt++; cout << mx << "\n" << cnt; return 0; }
Leave a Comment