1714: 树状数组

Memory Limit:512 MB Time Limit:4.000 S
Judge Style:Text Compare Creator:
Submit:1 Solved:1

Description

Sample Input Copy

5 5
1 3 3
2 3 5
2 4 5
1 1 3
2 2 5

Sample Output Copy

1
0
665496236

HINT