| 比赛 | 2024暑假C班集训A | 评测结果 | AAAAAAAAAA | 
|---|---|---|---|
| 题目名称 | 轮子的旋转 | 最终得分 | 100 | 
| 用户昵称 | 李奇文 | 运行时间 | 0.037 s | 
| 代码语言 | C++ | 内存使用 | 3.39 MiB | 
| 提交时间 | 2024-07-10 10:25:49 | ||
#include<bits/stdc++.h>
using namespace std;
int n,t;
struct node{
	int f,t,w;
}e[1005];
bool cmp(node x,node y){
	return x.f<y.f;	
}
int main(){
	freopen("rotation.in","r",stdin);
	freopen("rotation.out","w",stdout);
	cin>>n;
	for(int i=1;i<n;i++){
		cin>>e[i].f>>e[i].t>>e[i].w;
	}
	sort(e+1,e+n,cmp);
	for(int i=1;i<n;i++){
		t^=e[i].w;
	}
	cout<<t;
	return 0;
}