#P3810. 【模板】三维偏序 / 陌上花开
【模板】三维偏序 / 陌上花开
Description
There are elements. The -th element has three attributes . Let be the number of such that , , , and .
For all , find the number of such that .
Input Format
The first line contains two integers , denoting the number of elements and the maximum attribute value.
The next lines each contain three integers , representing the three attribute values.
Output Format
Output lines. The -th line contains the number of such that .
10 3
3 3 3
2 3 3
2 3 1
3 1 1
3 1 2
1 3 1
1 1 2
1 2 2
1 3 2
1 2 1
3
1
3
0
1
0
1
0
0
1
Hint
For all testdata, it is guaranteed that ,.
Translated by ChatGPT 5
京公网安备 11011102002149号