QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#103192 | #5745. Graph Isomorphism | willow# | WA | 15ms | 3532kb | C++14 | 654b | 2023-05-04 18:26:57 | 2023-05-04 18:27:00 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int T, n, m, d[maxn];
int main() {
for(scanf("%d", &T); T --; ) {
scanf("%d%d", &n, &m);
for(int i = 1; i <= n; ++ i)
d[i] = 0;
for(int i = 1, u, v; i <= m; ++ i) {
scanf("%d%d", &u, &v);
++ d[u], ++ d[v];
}
sort(d + 1, d + n + 1);
if(d[1] == 0 && d[n] == 0) {
puts("YES");
}
else if(d[1] == 1 && d[n - 1] == 1 && d[n] == n - 1) {
puts("YES");
}
else if(d[1] == n - 1 && d[n] == n - 1) {
puts("YES");
}
else if(d[1] == 0 && d[2] == n - 2 && d[n] == n - 2) {
puts("YES");
}
else {
puts("NO");
}
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3428kb
input:
3 3 3 1 2 2 3 3 1 3 2 1 2 2 3 5 5 1 2 2 3 3 4 4 5 5 1
output:
YES YES NO
result:
ok 3 token(s): yes count is 2, no count is 1
Test #2:
score: 0
Accepted
time: 10ms
memory: 3532kb
input:
39982 3 2 2 1 3 2 2 1 1 2 2 1 2 1 3 3 3 1 2 3 1 2 2 1 1 2 3 3 3 1 3 2 2 1 2 1 1 2 3 2 1 2 3 1 3 3 2 1 3 1 2 3 2 1 1 2 3 2 2 1 3 2 3 3 2 3 3 1 2 1 3 3 2 1 1 3 2 3 3 3 3 1 3 2 1 2 2 1 2 1 2 1 2 1 3 1 3 1 2 1 2 1 2 1 1 2 3 2 1 3 3 2 3 2 1 2 1 3 3 2 3 2 1 3 2 1 1 2 3 2 3 2 3 1 3 3 2 3 3 1 1 2 2 1 1 2 3 ...
output:
YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES ...
result:
ok 39982 token(s): yes count is 39982, no count is 0
Test #3:
score: -100
Wrong Answer
time: 15ms
memory: 3376kb
input:
33365 3 3 3 1 2 3 2 1 2 1 2 1 4 6 1 2 3 4 4 2 2 3 3 1 4 1 2 1 1 2 2 1 1 2 4 5 1 4 1 2 4 2 3 4 1 3 4 3 4 2 2 1 1 3 3 1 3 2 4 3 1 3 1 2 3 4 3 3 3 2 3 1 2 1 3 1 2 3 3 1 1 3 3 1 2 1 3 2 1 3 3 2 4 5 3 1 4 2 3 4 2 3 2 1 4 2 1 2 3 2 2 1 2 1 3 2 1 2 2 3 3 1 3 2 4 1 3 4 3 1 2 1 4 3 1 2 4 2 3 2 2 1 2 1 4 5 3 ...
output:
YES YES YES YES YES NO NO YES NO YES YES YES YES YES NO NO YES YES YES NO YES YES YES NO YES YES YES YES YES YES YES YES NO NO YES YES YES YES NO NO NO YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES NO YES NO YES YES YES NO YES YES NO YES NO YES NO YES YES YES YES NO YES YES YES YES YES ...
result:
wrong answer expected YES, found NO [83rd token]