/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 344.0 KiB
#2 Wrong Answer 1ms 368.0 KiB

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 + 2)-4) << 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:26:11
Judged At
2025-09-02 17:26:11
Judged By
Score
0
Total Time
1ms
Peak Memory
368.0 KiB