QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#597374#7755. Game on a ForestshmilycWA 1ms5272kbC++20749b2024-09-28 17:41:312024-09-28 17:41:31

Judging History

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

  • [2024-09-28 17:41:31]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5272kb
  • [2024-09-28 17:41:31]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

#define endl '\n'

const int N=1e5+5;
#define ll long long
#define mp make_pair


vector<vector<int> > a(N);
bool check[N];

int num[5];
//num 1 一个点的树  2  两个点的树,答案贡献为2
//3  3个点以上的普通树,答案贡献n-1,并且一个树   4  特殊直径2,点为偶数的树,答案贡献1

void solve()
{
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=m;i++){
        int x,y;
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    cout<<n-1;
    return;
}

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int T;
    cin>>T;
    while(T--)
        solve();
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 5272kb

input:

3 1
1 2

output:

000

result:

wrong output format Expected integer, but "000" found