1 条题解

  • 0
    @ 2024-12-7 11:05:44
    #include <math.h>
    #include <stdio.h>
    int main() {
        int n, x, ans = 0;
        scanf("%d", &n);
        for (int i = 1; i <= n; i++)
            for (int j = 1; j <= n; j++) {
                scanf("%d", &x);
                if (i - j == 0) ans += x;
                if (i + j == n + 1) ans -= x;
            }
        printf("%d", abs(ans));
        return 0;
    }
    
    • 1

    信息

    ID
    449
    时间
    1000ms
    内存
    256MiB
    难度
    5
    标签
    (无)
    递交数
    123
    已通过
    44
    上传者