ACdream群OJ--1035
2014-05-01 01:06
274 查看
An Unfair Game
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 128000/64000 KB (Java/Others)SubmitStatistic Next
Problem
Problem Description
There are n people and n target, everyone should get one target, no two people get the same target, the last one who get the target should be punished, there is only one person will be punished, so if more than one person are the last, no one will be punished.As the judge, you know exactly how much time that people i getting target j will spend, but there are no people know how much time he needs. You need to arrange for a target to everyone, and you want the i-th people to be punished (Now you know why it is an
unfair game?).
Input
The input contains several test, and ends with EOF. For each test, the first line has an integer n,which is the number of people and target,next there is an integer matrix which size is n*n, the i-th row and thej-th colume of matrix means the time that i-th person needs to get target j. Next line is a number m, the number of the person who you want to be punished.
1<=m<n<=100
Output
Each test print one line, the number of the target that m-th person gets, if there are more than one answer, print all of them. If there is no answer, only print -1.
Sample Input
3 1 2 3 2 3 4 3 4 5 3 3 3 3 3 2 2 2 1 1 1 3
Sample Output
2 3 -1
Source
UUZ
Manager
nanaeSubmitStatistic
相关文章推荐
- PKU_ACM_1035_Spell checker
- Poj 1035 --Spell checker
- 杭电 hdu 1035 Robot Motion
- 【Q】【POJ 1035】
- poj 1035(Wrong Answer)
- poj 1035
- poj1035 Spell checker
- ZOJ 1708||hdu 1035 Robot Motion (链式前向星,dfs)
- PAT 1035 Password
- poj 1035 Spell checker
- HDU1035 Prime Ring Problem
- HDU 1035 Robot Motion(大模拟)
- 【PAT】1035. Password (20)
- lightoj 1035 Intelligent Factorial Factorization 因式分解
- poj1035 Spell checker
- poj1035 Spell Checker
- 我的poj第一道数据结构--poj1035
- POJ 1035 Spell checker (串)
- Light OJ 1035 Intelligent Factorial Factorization
- sicily 1035. DNA matching