QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#244569#5745. Graph Isomorphismucup-team870#WA 9ms3708kbC++141.0kb2023-11-09 11:59:172023-11-09 11:59:18

Judging History

你现在查看的是最新测评结果

  • [2023-11-09 11:59:18]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:3708kb
  • [2023-11-09 11:59:17]
  • 提交

answer

#include <bits/stdc++.h>
#define rep(i,l,r) for(int i=l; i<=r; i++)
#define per(i,r,l) for(int i=r; i>=l; i--)
#define IOS {cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);}
using namespace std;

typedef long long ll;
typedef pair<int,int> P;

int du[100010];

int main() {
    int T; scanf("%d", &T);
    while (T--) {
        int n, m; scanf("%d%d", &n, &m);
        rep (i, 1, m) {
            int u, v;
            scanf("%d%d", &u, &v);
            du[u]++, du[v]++;
        }
        if (m == 1ll * n * (n-1)/2) {
            puts("YES");
        } else if (n <= 3) {
            puts("YES");
        } else {
            int mn = 1e9;
            rep (i, 1, n) mn = min(mn, du[i]);
            if (mn == 0 && m == 1ll * (n-1) * (n-2)/2) {
                puts("YES");
            } else if (n == 4 && du[1] == 1 && du[2] == 1 && du[3] == 1 && du[4] == 1){
                puts("YES");
            } else {
                puts("NO");
            }
        }
        rep (i, 1, n) du[i] = 0;
    }

    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3492kb

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: 9ms
memory: 3708kb

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: 9ms
memory: 3456kb

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
NO
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
Y...

result:

wrong answer expected YES, found NO [22nd token]