Submission #553026

#TimeUsernameProblemLanguageResultExecution timeMemory
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"); }

Compilation message (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...