Problem2014--noip2017 棋盘

2014: noip2017 棋盘

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1  Solved: 1
[Status] [Submit] [Creator:]

Description

Sample Input Copy

5 7
1 1 0
1 2 0
2 2 1
3 3 1
3 4 0
4 4 1
5 5 0

Sample Output Copy

8

HINT

Source/Category