QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#318179#3558. Constellation 3tojCompile Error//C++17844b2024-01-30 17:45:232024-01-30 17:45:24

Judging History

This is the latest submission verdict.

  • [2024-01-30 17:45:24]
  • Judged
  • [2024-01-30 17:45:23]
  • Submitted

answer

// S2OJ Submission #1190 @ 1706607922946
#include <bits/stdc++.h>
#define int long long
using namespace std;

const int N = 2e5 + 1;
int n, m;
vector<int> z[N];
vector<pair<int, int>> st[N];

struct Bcj {
	 int fa[N];
	 for (int i = 1; i <= n; ++i) fa[i] = i;
	 int find(int x) {return x == fa[x] ? x : find(fa[x]);}
};

struct Szsz {
#define lowbit(i) i & -i
	int t[N];
	int sum(int i) {
		int ans = 0;
		for (; i; i -= lowbit(i)) ans += t[i];
		return ans;
	}
	void add(int i, int x) {
		for (; i <= n; i += lowbit(i)) t[i] += x;
	}
};

signed main() {
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		int a; cin >> a;
		z[a].push_back(i);
	}
	cin >> m;
	for (int i = 1; i <= m; ++i) {
		int x, y, c; cin >> x >> y >> c;
		st[y].push_back(make_pair(x, c));
	}
	
	Szsz cost;
	Bcj L, R;
	
	
	return 0;
}

詳細信息

answer.code:13:10: error: expected unqualified-id before ‘for’
   13 |          for (int i = 1; i <= n; ++i) fa[i] = i;
      |          ^~~
answer.code:13:26: error: ‘i’ does not name a type
   13 |          for (int i = 1; i <= n; ++i) fa[i] = i;
      |                          ^
answer.code:13:34: error: expected unqualified-id before ‘++’ token
   13 |          for (int i = 1; i <= n; ++i) fa[i] = i;
      |                                  ^~