2 solutions
-
0
#include <bits/stdc++.h> #define endl '\n' using namespace std; typedef pair<int, int> PII; using ll = long long; using ULL = unsigned long long; const int N = 1e7 + 5; int n, a[N]; inline void solve() { cin >> n; ll sum = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } cout << *max_element(a,a+n) << endl << *min_element(a,a+n) << endl << sum << endl; } int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); int _ = 1; //int _; cin >> _; while (_--) solve(); return 0; }
Information
- ID
- 1832
- Time
- 1000ms
- Memory
- 512MiB
- Difficulty
- 4
- Tags
- # Submissions
- 43
- Accepted
- 20
- Uploaded By