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 total = 0;
for (int i = 0; i < n; i++) {
total += A[i];
}
cout << total << endl;
if (n % 2 == 0) {
int c = total * n;
cout << c << endl;
}
else if (n == 1) {
cout << n << endl;
}
else {
int p = total * (n + 1);
cout << p << 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:13:07
- Judged At
- 2025-09-02 17:13:07
- Judged By
- Score
- 0
- Total Time
- 4ms
- Peak Memory
- 532.0 KiB