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.


-2 -1 0 1 4
-3 -2 -1 1 2 3
0 4

hide comments
swaraj007: 2019-02-15 22:41:08

simple set difference operation

akshayawate007: 2018-11-27 12:20:07

how to print unique elements>

jonmanu: 2018-08-10 15:29:49

my code is working pretty fine in devc++ but i am getting WA in spoj .dont know why? any suggestions?

Last edit: 2018-08-10 15:30:10
taidev198: 2018-04-21 06:33:31

anjali1998:please check size of arr1 and arr2

abhi_code_deep: 2017-12-15 11:24:54


Last edit: 2017-12-15 11:25:26
vishwanath_26: 2017-07-19 04:18:27

AC in one go!

shrikant_001: 2016-12-06 15:36:07

guess what my code gives the same output but is not accepted by SPOJ.

keshav_786: 2016-11-04 06:02:47

what an easy one!!!

prad143: 2016-08-27 11:42:28

Do i need to assume the array is sorted or do i need to sort the array myself???

anjali1998: 2016-08-07 17:55:05

My code compiled correctly in ideone but here it's showing wrong answer...please help.

Added by:kuszi
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64