您的位置:首页 > 大数据 > 人工智能

一个acm试题,怎样判断是不是数据结尾

2007-07-26 09:50 429 查看
If a tree falls in the forest, and there's nobody there to hear, does it make a sound? This classic conundrum was coined by George Berkeley (1685-1753), the Bishop and influential Irish philosopher whose primary philosophical achievement is the advancement of what has come to be called subjective idealism. He wrote a number of works, of which the most widely-read are Treatise Concerning the Principles of Human Knowledge (1710) and Three Dialogues between Hylas and Philonous (1713) (Philonous, the "lover of the mind," representing Berkeley himself).

Input

A forest contains T trees numbered from 1 to T and P people numbered from 1 to P. Standard input consists of a line containing P and T followed by several lines, containing a pair of integers i and j, indicating that person i has heard tree j fall. People may have different opinions as to which trees, according to Berkeley, have made a sound.

Input contains multiple test cases. Subsequent test cases are separated with a single blank line.

Output

How many different opinions are represented in the input? Two people hold the same opinion only if they hear exactly the same set of trees. You may assume that P < 100 and T < 100.

Sample Input

3 4
1 2
3 3
1 3
2 2
3 2
2 4

Sample Output

2

请问我怎样才知道当输入2 4的时候代表数据输入完毕
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  input output tree pair
相关文章推荐