QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#791597 | #9743. 重心树 | bluejellyfish | Compile Error | / | / | C++23 | 701b | 2024-11-28 19:48:21 | 2024-11-28 19:48:22 |
Judging History
This is the latest submission verdict.
- [2024-11-28 19:48:22]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-11-28 19:48:21]
- Submitted
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
//#define x first
//#define y second
const int mod = 1e9 + 7;
int f[300000];
int find(int x) {
if(x != f[x]) x = f[x] = f[f[x]];
return f[x];
}
void miss() {
int n;
cin >> n;
vector<vector<int>>mp(n + 1);
for(int i = 1; i <= n; i++) {
f[i] = i;
int x;
for(cin >> x; x; x--) {
int it;
cin >> it;
mp[i].push_back(it);
}
}
for(int i = n; i; i--) {
for(auto x : mp[i]) {
cout << i << " " << find(x);
fa[find(x)] = i;
}
}
}
signed main() {
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int T = 1;
cin >> T;
while(T--) miss();
}
詳細信息
answer.code: In function ‘void miss()’: answer.code:29:25: error: ‘fa’ was not declared in this scope; did you mean ‘fma’? 29 | fa[find(x)] = i; | ^~ | fma