QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#653286#7755. Game on a ForestanlanyiWA 2ms5912kbC++20602b2024-10-18 19:50:132024-10-18 19:50:13

Judging History

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

  • [2024-10-18 19:50:13]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:5912kb
  • [2024-10-18 19:50:13]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1e6+10;
using ll=long long ;
long long    f[N];
pair<char,array<ll  ,4>>w[N];
int vis[N];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    vector<vector<int >>h(n+1);
    vector<int >vis(n+1); 
    for(int i=1;i<=m;i++){ 
        int a,b;
        cin >> a >> b;
        h[a].push_back(b);
        h[b].push_back(a);
        vis[a]++;
        vis[b]++;
    }
    int cnt=0;
    for(int i=1;i<=n;i++){
        cnt+=vis[i]==0;
    }
   cout<<(n+m)/2+cnt/2;

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 1
1 2

output:

2

result:

ok 1 number(s): "2"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

4 3
1 2
2 3
3 4

output:

3

result:

ok 1 number(s): "3"

Test #3:

score: -100
Wrong Answer
time: 2ms
memory: 5912kb

input:

100000 1
4647 17816

output:

99999

result:

wrong answer 1st numbers differ - expected: '1', found: '99999'