0分求助原因

P4387 【深基15.习9】验证栈序列

Dreamland_ @ 2024-12-02 23:01:13

include<stdio.h>

int main() { int q; scanf("%d", &q); for(int c=0;c<q;c++){ long long n; scanf("%lld", &n); long long a[100000] = { -1 }; for (int i = 0; i < n; i++) { scanf("%llld", &a[i]); } long long b[100000] = { -1 }; for (int j = 0; j < n; j++) { scanf("%lld", &b[j]); } long long p1 = a; long long p2 = b; p2 = p2 + n-1; int s; for (int z = 0; z < n; z++) { if (p1 != p2) { s = 1; printf("NO\n"); break; } else { s = 0; } p1 = p1 + 1; p2 = p2 - 1; } if (s == 0) { printf("YES\n"); } } return 0; }

#include<stdio.h>
int main() {
    int q;
    scanf("%d", &q);
    for(int c=0;c<q;c++){
    long long n;
    scanf("%lld", &n);
    long long a[100000] = { -1 };
    for (int i = 0; i < n; i++) {
        scanf("%llld", &a[i]);
    }
    long long b[100000] = { -1 };
    for (int j = 0; j < n; j++) {
        scanf("%lld", &b[j]);
    }
    long long* p1 = a;
    long long* p2 = b;
    p2 = p2 + n-1;
    int s;
    for (int z = 0; z < n; z++) {
        if (*p1 != *p2) {
            s = 1;
            printf("NO\n");
            break;
        }
        else {
            s = 0;
        }
        p1 = p1 + 1;
        p2 = p2 - 1;
    }
    if (s == 0) {
        printf("YES\n");
    }
    }
    return 0;
}

by Littlecowr @ 2024-12-10 22:49:02

唉,我也跟你一样,你再仔细看看输出大小写 :)


|