Hi! I have attempted this problem numerous times and get a Runtime Error in test case 8 with exit code -1073741819 Here is the link to the problem: http://codeforces.me/contest/1148/problem/B Here is my attempt by using two-pointers method to solve it. http://codeforces.me/contest/1148/submission/55003260 Thanks!
b[m-(k-i)-1]
is out of bounds ifm == k
andi == 0
while(a[i]+ta>b[j])++j;
you dot't check the bounds forj
j+=k-i;
maybe out of bounds too?