# No matching function for call to ‘Solution::findMedianSortedArrays(std::vector<int>&, std::vector<int>&)’

• ``````class Solution {
public:
static int findkth(int A[],int abeg,int aend,int B[],int bbeg,int bend,int k){
if(abeg>aend) return B[bbeg+k-1];
if(bbeg>bend) return A[abeg+k-1];
int amid=abeg+(aend-abeg)/2;
int bmid=bbeg+(bend-bbeg)/2;
int halflen=amid-abeg+bmid-bbeg+2;
if(A[amid]<B[bmid]){
if(halflen>k) return findkth(A,abeg,aend,B,bbeg,bmid-1,k);
else return findkth(A,amid+1,aend,B,bbeg,bend,k-(amid-abeg+1));
}
else{
if(halflen>k) return findkth(A,abeg,amid-1,B,bbeg,bend,k);
else return findkth(A,abeg,aend,B,bmid+1,bend,k-(bmid-bbeg+1));
}
}
double findMedianSortedArrays(int A[], int m, int B[], int n) {
if((m+n)%2) return findkth(A,0,m-1,B,0,n-1,(m+n)/2+1);
else return (findkth(A,0,m-1,B,0,n-1,(m+n)/2)+findkth(A,0,m-1,B,0,n-1,(m+n)/2+1))*1.0/2;
}
};``````

• there is no function for vector<int>,but int[] ?

• I met this problem in another problem set too. For the first time, I admitted the code and it was accepted. However, the second time I admit the same code, notice that I don't make any changes, the system tells the similar compile error like yours. I think, it may be some bug of the system at a time.

• Yes,maybe you are right,because my code is accepted in compiler visual c++ 6.0.Thanks!

• Sorry,I don't understand.What 's the problem with my code?