#P3907. 环的异或
环的异或
Description
Given an undirected graph , the weight of edge is . Determine whether the following property holds: For any cycle , the XOR of the edge weights along is .
Input Format
The first line contains an integer , denoting the number of test cases. For each test case, the first line contains two integers , denoting the numbers of vertices and edges of graph . The next lines each contain three integers .
Output Format
For each test case, output one line: Yes or No.
2
3 3
1 2 1
2 3 2
3 1 3
1 1
1 1 1
Yes
No
Hint
- For 50% of the testdata, .
- For 100% of the testdata, , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号