/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 2ms 1.324 MiB
#2 Wrong Answer 2ms 1.324 MiB

Code

#include <stdio.h>

#define Mn 100000

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

    while (T--) {
        int N, A[Mn], B[Mn], C[Mn], 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:49:05
Judged At
2024-11-11 03:38:02
Judged By
Score
0
Total Time
2ms
Peak Memory
1.324 MiB