QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#633014#7755. Game on a ForesttsaiWA 3ms27144kbC++14695b2024-10-12 14:22:312024-10-12 14:22:31

Judging History

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

  • [2024-10-12 14:22:31]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:27144kb
  • [2024-10-12 14:22:31]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int>v[1000050];
void solve(){
	int n,m;
	scanf("%d %d", &n,&m);
    for(int i=1;i<=n;i++){
    	v[i].clear();
	}
    for(int i=1;i<=m;i++){
    	int x,y;
    	scanf("%d %d",&x,&y);
    	v[x].push_back(y);
    	v[y].push_back(x);
	}
    int point=0;//孤点
    int okpoint=0;
    for(int i=1;i<=n;i++){
    	if(v[i].size()==0){
    		point++;
		}
		okpoint++;
	}
    if(okpoint%2==0){
    	printf("%d",m+point);
	}else{
		printf("%d",okpoint);
	}
    
    return ;
}

int main(){
//	int t;
//	scanf("%d",&t);
//	while(t--){
		solve();
//		if(t) printf("\n");
//	}
	
	return 0;	
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 27144kb

input:

3 1
1 2

output:

3

result:

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