Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> A(n);
for (int i = 0; i < n; i++) {
cin >> A[i];
}
int mx = *max_element(A.begin(), A.end());
cout << mx << endl;
int total = 0;
for (int i = 0; i < n; i++) {
total += A[i];
}
if (n % 2 == 0) {
cout << total * n << endl;
}
else if (n == 1) {
cout << n << endl;
}
else {
cout << total * (n + 1) << endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1105 Ohh that gcd again
- Contest
- LUCC Presents Intra LU Junior Programming Contest - Replay
- Language
- C++11 (G++ 13.2.0)
- Submit At
- 2025-09-02 17:22:21
- Judged At
- 2025-09-02 17:22:21
- Judged By
- Score
- 0
- Total Time
- 4ms
- Peak Memory
- 532.0 KiB