Processing math: 100%
祝同学们学习进步,编程快乐!
Problem 2638 --Set Operation - Set Symmetric Difference

2638: Set Operation - Set Symmetric Difference

"
Time Limit 3 秒/Second(s) Memory Limit 512 兆字节/Megabyte(s)
提交总数 8 正确数量 8
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 STL

Set Symmetric Difference

Find the symmetric difference of two sets A={a0,a1,...,an1}A={a0,a1,...,an−1} and B={b0,b1,...,bm1}B={b0,b1,...,bm−1}.



Input

The input is given in the following format.

nn 
a0a1...an1a0a1...an−1 
mm 
b0b1...bm1b0b1...bm−1 

Elements in AA and BB are given in ascending order. There are no duplicate elements in each set.



Output

Print elements in the symmetric difference in ascending order. Print an element in a line.

7
1 2 3 4 5 6 7
4
2 4 6 8
1
3
5
7
8

Constraints

  • 1n,m200,0001≤n,m≤200,000
  • 0a0<a1<...<an11090≤a0<a1<...<an−1≤109
  • 0b0<b1<...<bm11090≤b0<b1<...<bm−1≤109



推荐代码 查看2638 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[0 ms] AOJ大管家 437020 2019-06-06 23:29:08
内存最少[0 KB] Qiqy 609159 2020-08-02 09:54:37
第一AC 刘成健 322016 2018-11-21 11:14:46
第一挑战 刘成健 322016 2018-11-21 11:14:46

赛题来源/所属竞赛 会津大学《C++ Programming II》 C++程序设计(高级)

竞赛编号 竞赛名称 竞赛时间 访问比赛
AOJ
祝同学们学习进步,编程快乐!