70pts不知道哪里错了求助!
查看原帖
70pts不知道哪里错了求助!
857665
doumingze楼主2022/12/10 22:33
#include<bits/stdc++.h>
using namespace std;

int a[1000010];

int main()
{
//	freopen("queries4.in", "r", stdin);
//	freopen("queries4.out", "w", stdout);
	int n, m;
	cin >> n >> m;
	for(int i = 1; i <= n; i ++) cin >> a[i];
	int x, y;
	for(int i = 0; i < m; i ++)
	{
		cin >> x >> y;
		a[x] -= y;
	}
	bool f = 1;
	for(int i = 1; i <= n; i ++)
	{
		if(f) f = 0;
		else cout << " ";
		cout << a[i];
	}
	puts("");
	return 0;
}
2022/12/10 22:33
加载中...