编程介的小学生 2017-06-02 08:17 采纳率: 20.3%
浏览 861
已采纳

Thanks for your love

Problem Description
Thanks for your love------Do not ask me how many people ever I loved,you do not know how deep my injury. Did not dare, do not want to, should not be, thank you for your love again. I had to exist like a dust or will bring you harm. Did not dare, do not want to, should not be, thank you for your love again. I had to exist in your future.
This is my most fear that brought to your harm Forever.

Zty have N friends, most friends in his feeling were the same but exactly one (while all other people are equal in his felling). In order to detect which is the people that he has different feeling, he ask himself a lot of questions. With this question , your task is to determine the identifier of the friend who he has different feeling about using the results of these questions. We assigning each friend of him a unique integer identifier from 1 to N.

Input
The first line of the input file contains two integers N and M, separated by spaces, where N is the number of friends Zty has (2<=N<=10000 ) and M is the number of questions fulfilled (1<=M<=100). The following 2M lines describe all questions. Two consecutive lines describe each question. The first of them starts with a number Ti (1 <= Ti <= N/2), representing the number of friends placed in the left group and in the right group, followed by Ti identifiers of friends placed in the left group and Ti identifiers of friends placed in the right group. All numbers are separated by spaces. The second line contains one of the following characters: '<', '>', or '='.
It represents the result of the sum feelings:
'<' means that the sum of all the feeling in the left group is less than the sum of all the feeling in the right group.
'>' means that the sum of all the feeling in the left group is greater than the sum of all the feeling in the right group,
'=' means that the sum of all the feeling in the left group is equal to the sum of all the feeling in the right group.

Output
Write to the output file the identifier of the friend or 0, if it cannot be found by the results of the given questions.

Sample Input
5 3

1 1 2

1 3 4

1 4 5

Sample Output
3

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-06-04 17:52
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)