Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
归并
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 149, Accepted users: 138
Problem 10492 : No special judgement
Problem description
  已知a,b两个按学号升序排列的链表,每个链表中的结点包括学号、成绩,均为整型。要求把两个链表合并,合并后的链表还是按学号升序排列。

Input
  输入数据有若干组。每组数据第一行是一个整数n,表示链表an个结点,接下来n行为n个结点数据(学号 成绩),第n+1行是一个整数m,表示链表bm个结点,接下来m行为m个结点数据。

Output
  对每组数据,输出a、b合并后的c。学号和成绩之间用空格分隔,两组数据之间空一行。

Sample Input
2
1001 98
1002 100
1
1003 88
3
1003 88
1004 94
1005 76
2
1001 97
1002 68
Sample Output
1001 98
1002 100
1003 88
 
1001 97
1002 68
1003 88
1004 94
1005 76 
Submit   Clarifications   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:2017 today,16258744 total, since 2010-05-07