10分WA,求助dalao
查看原帖
10分WA,求助dalao
906102
xiaozhangawa楼主2023/11/19 10:21

rt,我的代码如下:

#include <bits/stdc++.h>
using namespace std;
int a[1000010];
int main(){
	int t;
	cin>>t;
	while(t--){
		int cmd;
		cin>>cmd;
		if(cmd == 1){
			int x,y;
			cin>>x>>y;
			a[x] = y;
		}else if(cmd == 2){
			int x;
			cin>>x;
			cout<<a[x]<<endl;
		}else if(cmd == 3){
			int x;
			cin>>x;
			a[x] = a[a[x]];
		}
	}
	return 0;
}

2023/11/19 10:21
加载中...