Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Card Game
Description Jack and Joe are playing a special card game in which each card has some points in three properties - The card has more points in
*apo*is more powerful. - If two cards have the same points in
*apo,*the one has more points in*bqu*is more powerful. - If two cards have the same points in
*apo*and*bqu*, one has more points in*cri*is more powerful. - If two cards have the same points in
*apo*,*bqu*and*cri*, Jack's card is more powerful.
After the compare, Joe's card is discarded so that he can never use it any more. To make the game more competitive, Jack and Joe are given Joe wants to know how many rounds he can win if they both plays optimally. Input Input consists several test case. The first line of each test case is The following N lines describe the cards. Each line contains three integers The last of each test case is The input ends with Output For each test case, output how many rounds Joe can win. Sample Input 3 0 0 0 1 0 0 1 0 0 1 3 0 0 0 0 0 0 0 0 0 0 0 Sample Output 2 0 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator