码迷,mamicode.com
首页 > 其他好文 > 详细

HDU 5101 Select(BestCoder Round #17)

时间:2015-11-04 21:14:35      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:

Problem Description:
One day, Dudu, the most clever boy, heard of ACM/ICPC, which is a very interesting game. He wants to take part in the game. But as we all know, you can‘t get good result without teammates.
So, he needs to select two classmates as his teammates. 
In this game, the IQ is very important, if you have low IQ you will WanTuo. Dudu‘s IQ is a given number k. We use an integer v[i] to represent the IQ of the ith classmate. 
The sum of new two teammates‘ IQ must more than Dudu‘s IQ.
For some reason, Dudu don‘t want the two teammates comes from the same class.
Now, give you the status of classes, can you tell Dudu how many ways there are.
 
Input:
There is a number T shows there are T test cases below. (T20)
For each test case , the first line contains two integers, n and k, which means the number of class and the IQ of Dudu. n ( 0n1000 ), k( 0k<231 ).
Then, there are n classes below, for each class, the first line contains an integer m, which means the number of the classmates in this class, and for next m lines, each line contains an integer v[i], which means there is a person whose iq is v[i] in this class. m( 0m100 ), v[i]( 0v[i]<231 )
 
Output:
For each test case, output a single integer.
 
Sample Input:
1
3 1
1 2
1 2
2 1 1
 
Sample Output:
5
 

HDU 5101 Select(BestCoder Round #17)

标签:

原文地址:http://www.cnblogs.com/syhandll/p/4936971.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!