QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#268864 | #7755. Game on a Forest | ucup-team134# | WA | 1ms | 6288kb | C++14 | 487b | 2023-11-28 22:33:10 | 2023-11-28 22:33:11 |
Judging History
answer
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
#define pb push_back
const int N=100050;
vector<int> E[N];
int main(){
int n,m;
scanf("%i %i",&n,&m);
for(int i=1;i<=m;i++){
int u,v;
scanf("%i %i",&u,&v);
E[u].pb(v);
E[v].pb(u);
}
int ans=0;
if(n%2==0)ans=m;
else{
for(int i=1;i<=n;i++){
int e=E[i].size();
if(e%2==m%2){
ans++;
}
}
}
printf("%i\n",ans);
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 6092kb
input:
3 1 1 2
output:
2
result:
ok 1 number(s): "2"
Test #2:
score: 0
Accepted
time: 0ms
memory: 6288kb
input:
4 3 1 2 2 3 3 4
output:
3
result:
ok 1 number(s): "3"
Test #3:
score: 0
Accepted
time: 1ms
memory: 6216kb
input:
100000 1 4647 17816
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: -100
Wrong Answer
time: 1ms
memory: 6200kb
input:
100000 2 64075 72287 63658 66936
output:
2
result:
wrong answer 1st numbers differ - expected: '0', found: '2'