SMPSEQ3 - Fun with Sequences
You are given a sorted sequence of n integers S = s1, s2, ..., sn and a sorted sequence of m integers Q = q1, q2, ..., qm. Please, print in the ascending order all such si that does not belong to Q.
Input data specification
In the first line you are given one integer 2<=n<=100,
and in the following line n integers:
-100 <= si <= 100, si <= si+1.
In the third line you are given one integer 2<=m<=100,
and in the following line m integers:
-100 <= qi <= 100, qi <= qi+1.
Output data specification
The sequence of requested integers separated by spaces.
Input: 5 -2 -1 0 1 4 6 -3 -2 -1 1 2 3 Output: 0 4
my code is working pretty fine in devc++ but i am getting WA in spoj .dont know why? any suggestions?
anjali1998:please check size of arr1 and arr2
Sorry.Last edit: 2017-12-15 11:25:26
AC in one go!
guess what my code gives the same output but is not accepted by SPOJ.
what an easy one!!!
Do i need to assume the array is sorted or do i need to sort the array myself???
My code compiled correctly in ideone but here it's showing wrong answer...please help.
BINARY SERACH ROCKS!!!!!!!!!!!!