有没有大佬帮我这个蒟蒻看看
  • 板块灌水区
  • 楼主zhaocaimaolaile
  • 当前回复4
  • 已保存回复4
  • 发布时间2024/3/10 11:13
  • 上次更新2024/3/10 13:34:15
查看原帖
有没有大佬帮我这个蒟蒻看看
666358
zhaocaimaolaile楼主2024/3/10 11:13

不知道为什么只对了一个点

题目:题目

代码:

#include<bits/stdc++.h>
using namespace std;

const int maxn = 1e6 + 10;
struct Node{
	int l,n,val;
}a[maxn];
int main(){
	int q,k,x,y;
	cin >> q;
	for(int i = 1; i <= q; ++ i){
		cin >>  k;
		if(k == 1){
			cin >> x >> y;
			a[x].n = y;
		}
		else if(k == 2){
			cin >> x;
			if(a[x].n == 0)
				cout << 0 << endl;
			else
				cout << a[x].n << endl;
		}
		else if(k == 3){
			cin >> x;
			a[x].n = 0;
		}
	} 
	return 0;
}
2024/3/10 11:13
加载中...