QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#268864#7755. Game on a Forestucup-team134#WA 1ms6288kbC++14487b2023-11-28 22:33:102023-11-28 22:33:11

Judging History

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

  • [2023-11-28 22:33:11]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:6288kb
  • [2023-11-28 22:33:10]
  • 提交

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'