제출 #553026

#제출 시각아이디문제언어결과실행 시간메모리
553026PherokungNewspapers (CEOI21_newspapers)C++14
0 / 100
1 ms300 KiB
#include<bits/stdc++.h>
using namespace std;
int n,m,u,v,hsh[1005];
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++){
		scanf("%d%d",&u,&v);
		hsh[u]++, hsh[v]++;
	}
	for(int i=1;i<=n;i++){
		if(hsh[i] == n-1){
			printf("YES\n2\n%d %d",i,i);
			return 0;
		}
	}
	printf("NO");
}

컴파일 시 표준 에러 (stderr) 메시지

newspapers.cpp: In function 'int main()':
newspapers.cpp:5:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 |  scanf("%d%d",&n,&m);
      |  ~~~~~^~~~~~~~~~~~~~
newspapers.cpp:7:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |   scanf("%d%d",&u,&v);
      |   ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...