OJ不通过,报Wrong Answer,是有什么情况没考虑到吗?


#include<iostream>
using namespace std;

int sort (int a[],int r[],int s,int t) {
    if (s==t) {
        return a[0];
    }
    int mid= (s+t) /2;
    sort (a,r,s,mid);
    sort (a,r,mid+1,t);
    int i=s,j=mid+1,k=s;
    while (i<=mid&&j<=t) {
        if (a[i]<=a[j]) {
            r[k]=a[i];
            i++;
            k++;
        } else {
            r[k]=a[j];
            j++;
            k++;
        }
    }
    while (i<=mid) {
        r[k]=a[i];
        k++;
        i++;
    }
    while (j<=t) {
        r[k]=a[j];
        k++;
        j++;
    }
    for (int i=s; i<=t; i++) {
        a[i]=r[i];
    }
    return 0;
}

int main() {
    int n,m,y=0;
    cin>>n>>m;
    int a[n],b[m],c[n+m],d[n+m];
    for (int i=0; i<n; i++) {
        int x;
        cin>>x;
        a[i]=x;
    }
    for (int i=0; i<m; i++) {
        int x;
        cin>>x;
        b[i]=x;
    }
    for (int i=0; i<n; i++) {
        c[i]=a[i];
    }
    for (int i=n; i<n+m; i++) {
        c[i]=b[y];
        y++;
    }
    sort (c,d,0,n+m);
    for (int i=0; i<n+m; i++) {
        cout<<d[i]<<" ";
    }
    return 0;
}

sort (c,d,0,n+m)
改为
sort (c,d,0,n+m-1);

题目要求是什么呢,不然不好找哪里错了

题目都没有,怎么通过