/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 2ms 1.312 MiB
#2 Wrong Answer 2ms 1.551 MiB

Code

#include <stdio.h>

#define M_n 100000

int main() {
    int T;
    scanf("%d", &T);

    while (T--) {
        int N, A[M_n], B[M_n], C[M_n], SUM = 0;
        scanf("%d", &N);

        for (int i = 0; i < N; i++) scanf("%d", &A[i]);
        for (int i = 0; i < N; i++) scanf("%d", &B[i]);
        for (int i = 0; i < N; i++) scanf("%d", &C[i]);

        for (int i = 0; i < N; i++) {
            int currentSum = A[i] + B[i] + C[i];
            if (i > 0 && (A[i] == A[i - 1] || B[i] == B[i - 1] || C[i] == C[i - 1])) {
                if (i < N - 1) {
                    currentSum = A[i + 1] + B[i + 1] + C[i + 1];
                    i++;
                }
            }
            SUM += currentSum;
        }

        printf("%d\n", SUM);
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1046 Maximum sum in 3-array
Contest
TLE_Headquarters - round #1
Language
C99 (GCC 13.2.0)
Submit At
2024-03-27 16:50:08
Judged At
2024-11-11 03:38:00
Judged By
Score
0
Total Time
2ms
Peak Memory
1.551 MiB