QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#462543 | #8724. September | hhoppitree | 0 | 1ms | 3804kb | C++17 | 609b | 2024-07-03 20:44:45 | 2024-07-03 20:44:46 |
answer
#include <bits/stdc++.h>
using namespace std;
int solve(int n, int m, vector<int> fa, vector< vector<int> > p) {
vector< vector<int> > G(n);
for (int i = 1; i < n; ++i) G[i].push_back(fa[i]), G[fa[i]].push_back(i);
unordered_map<int, int> M;
map< pair<int, int>, int> E;
int res = 1;
for (int i = 0; i < n - 1; ++i) {
for (int j = 0; j < m; ++j) {
++M[p[j][i]];
for (auto v : G[p[j][i]]) E[make_pair(min(p[j][i], v), max(p[j][i], v))] = 1;
}
res += (M.size() == i + 1 && M.size() == E.size());
}
return res;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3656kb
input:
txy4h26c1rm1uv8tr3eonahd67u8h56x 4 7 1 0 0 2 3 3 5 1 6 4 3 5 2 10 1 0 1 2 0 3 0 5 4 8 9 7 6 8 4 5 3 2 1 7 1 0 0 0 1 3 0 2 4 1 6 5 3 6 1 0 0 1 1 3 4 5 2 3 1
output:
7ckgnn4wyi495puj3ibqf81dqvapyv6b 6 10 7 6
result:
wrong answer 2nd lines differ - expected: '5', found: '6'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Wrong Answer
Test #17:
score: 0
Wrong Answer
time: 1ms
memory: 3804kb
input:
txy4h26c1rm1uv8tr3eonahd67u8h56x 53 10 1 0 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 10 1 0 1 2 3 4 5 6 7 8 9 7 8 5 6 4 3 2 1 10 1 0 1 2 3 4 5 6 7 8 8 9 7 5 6 3 2 4 1 10 1 0 1 2 3 4 5 6 7 8 8 9 6 7 5 4 3 2 1 10 1 0 1 2 3 4 5 6 7 8 8 9 7 5 6 3 4 2 1 10 1 0 1 2 3 4 5 6 7 8 9 8 7 6 5 4 2 3 1 10 1 0 1 2 3 4 5 6...
output:
7ckgnn4wyi495puj3ibqf81dqvapyv6b 10 8 6 8 7 9 7 9 8 7 5 6 9 7 10 8 8 7 9 8 31 30 25 21 23 60 568 59 34 26 31 38 35 8 4 9 5 9 8 7 5 6 8 7 7 9 5 7 6 8 7 10 7
result:
wrong answer 2nd lines differ - expected: '9', found: '10'
Subtask #4:
score: 0
Skipped
Dependency #1:
0%
Subtask #5:
score: 0
Skipped
Dependency #3:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
0%
Subtask #7:
score: 0
Skipped
Dependency #3:
0%
Subtask #8:
score: 0
Skipped
Dependency #1:
0%
Subtask #9:
score: 0
Skipped
Dependency #3:
0%
Subtask #10:
score: 0
Skipped
Dependency #1:
0%