Cover

TimeLimit: 2000/1000 MS (Java/Others)  MemoryLimit: 65536/65536 K (Java/Others)
64-bit integer IO format:%I64d
Special Judge
未提交 | 登录后收藏
Problem Description
You have an n*n matrix.Every grid has a color.Now there are two types of operating:
L x y: for(int i=1;i<=n;i++)color[i][x]=y;
H x y:for(int i=1;i<=n;i++)color[x][i]=y;
Now give you the initial matrix and the goal matrix.There are $m$ operatings.Put in order to arrange operatings,so that the initial matrix will be the goal matrix after doing these operatings

It's guaranteed that there exists solution.
Input
There are multiple test cases,first line has an integer T
For each case:
First line has two integer n,m
Then n lines,every line has n integers,describe the initial matrix
Then n lines,every line has n integers,describe the goal matrix
Then m lines,every line describe an operating

1color[i][j]n
T=5
1n100
1m500
Output
For each case,print a line include m integers.The i-th integer x show that the rank of x-th operating is i
SampleInput
1
3 5
2 2 1 
2 3 3 
2 1 3 
3 3 3 
3 3 3 
3 3 3 
H 2 3
L 2 2
H 3 3
H 1 3
L 2 3
SampleOutput
5 2 4 3 1
Submit
题目统计信息详细
总AC数5
通过人数5
尝试人数6
总提交量11
AC率45.45%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: