For the below code I am getting the required output but when I hit the submit button it showing run-time error ?? Can you please help me out
My code
#include <bits/stdc++.h>
using namespace std;
using SIZE = long long;
int main() {
// your code goes here
SIZE t;
cin>>t;
while(t--)
{
SIZE sizeOfA,sizeOfB;
cin>>sizeOfA>>sizeOfB;
vector<SIZE> A(sizeOfA),B(sizeOfB);
for(SIZE i=0;i<sizeOfA;i++)
cin>>A[i];
for(SIZE i=0;i<sizeOfB;i++)
cin>>B[i];
auto start = A.end()-1;
//main
for(SIZE i=0;i<B.size();i++)
{
//set start
int it = B[i];
while(--it)
start--;
//sort A
sort(start,A.end());
}
for(auto x:A)
cout<<x<<" ";
cout<<endl;
}
}
Problem Link: ORST Practice Coding Problem - CodeChef