QOJ.ac

QOJ

ID提交记录ID题目HackerOwner结果提交时间测评时间
#1325#839079#7250. KorncheryAlicXSuccess!2025-01-01 14:29:192025-01-01 14:29:20

详细

Extra Test:

Wrong Answer
time: 0ms
memory: 3576kb

input:

8 10
1 2
2 3
1 3
3 4
3 5
4 5
5 6
6 7
7 8
5 8

output:

2
3 5 

result:

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

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#839079#7250. KornAlicXWA 23ms6760kbC++14809b2025-01-01 11:18:412025-01-01 14:31:17

answer

#include<bits/stdc++.h> 
#define int long long 
#define x first 
#define y second 
#define il inline 
#define em emplace 
#define eb emplace_back 
#define debug() puts("-----") 
using namespace std; 
typedef pair<int,int> pii; 
il int read(){ 
	int x=0,f=1; char ch=getchar(); 
	while(ch<'0'||ch>'9'){ if(ch=='-') f=-1; ch=getchar(); } 
	while(ch>='0'&&ch<='9') x=(x<<1)+(x<<3)+(ch^48),ch=getchar(); 
	return x*f; 
} 
const int N=2e5+10; 
int n,m; 
int d[N]; 
signed main(){ 
	n=read(),m=read(); 
	for(int i=1;i<=m;i++){  
		int u=read(),v=read(); 
		d[u]++,d[v]++; 	
	} for(int i=1;i<=n;i++) if(d[i]&1){ puts("0"); return 0; } 
	vector<int> vec; 
	for(int i=1;i<=n;i++) if(m-d[i]<n-1) vec.eb(i); 
	cout<<vec.size()<<endl; for(auto u:vec) cout<<u<<" "; cout<<endl; 
	return 0; 
}