cswork / OA打开练习工作台

SnowflakeOA #42

Process Logs

估计简单可在线判题

考点(AI 标注)哈希计数

Each log is sender recipient amount. A user is counted once for a log whenever they take part in it as the sender or the recipient; a transfer to oneself still counts only once. Output the ID of every user who takes part in at least threshold logs, sorted in ascending numeric order, not lexicographic string order. 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; each field is a positive decimal integer of 1..9 digits without leading zeros. The original text guarantees that at least one user is output.

输出格式

First output the number of users, then output each user ID in ascending numeric order.

样例 1

输入:

3 2
1 2 100
1 1 5
10 1 9

输出:

1
1

样例 2

输入:

1 1
2 10 1

输出:

2
2 10

样例 3

输入:

1 1
999999999 999999999 999999999

输出:

1
999999999

样例说明

The answers to the three public examples are, in order: 1 1; 2 2 10; 1 999999999. The examples were checked by independent enumeration, state search, or direct simulation.