D ACed,but why WA before
  • 板块学术版
  • 楼主Vitamin_B
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/9/28 21:42
  • 上次更新2024/9/29 10:44:26
查看原帖
D ACed,but why WA before
743373
Vitamin_B楼主2024/9/28 21:42

D ACed,but why WA before:

# include <bits/stdc++.h>

# define I return

# define AK 0

# define IOI ;

using namespace std;

typedef long long ll;

typedef pair <int, int> pii;

int n, m, x, y, z;

vector <pii> v[200005];

ll ans[200005];

int main () {

	ios::sync_with_stdio (0);

	cin.tie (0);

	cout.tie (0);

	cin >> n >> m;

	for (int i = 0; i < m; ++ i) {

		cin >> x >> y >> z;

		if (x > y)
			swap (x, y), z = -z;

		v[x].emplace_back (y, z);

	}

	for (int i = 1; i <= n; cout << ans[i] << ' ', ++ i)
		for (const pii& j : v[i])
			ans[j.first] = ans[i] + j.second;

	I AK IOI

}
2024/9/28 21:42
加载中...