IBMOA #64
Process Logs
估计简单可在线判题
Each log line records the sending user, the receiving user and the amount. Return the IDs of users involved in at least threshold logs, in ascending numeric order. A self-transfer log counts only once for that user, and the amount does not affect the count.
输入格式
The first line contains n threshold, followed by n lines of sender recipient amount. 1≤n≤100000, 1≤threshold≤n; all three fields are 1..9-digit decimal numbers whose first digit is non-zero, and the answer is guaranteed to be non-empty.
输出格式
Output the number of users on the first line, followed by one ID per line in ascending numeric order.
样例 1
输入:
3 2
2 10 7
10 10 8
2 3 9
输出:
2
2
10
样例 2
输入:
3 2
1 1 1
2 2 1
2 3 1
输出:
1
2
样例 3
输入:
1 1
99 100 1
输出:
2
99
100
样例说明
The outputs of the three public examples are, in order: 2 / 2 / 10; 1 / 2; 2 / 99 / 100. These answers were verified by independent enumeration or direct simulation.