Submission #29344

#TimeUsernameProblemLanguageResultExecution timeMemory
29344khsoo01Untitled (POI11_imp)C++11
100 / 100
1633 ms37296 KiB
#include<bits/stdc++.h> using namespace std; int n, m, adj[3005][3005]; bool d[3005]; int main() { scanf("%d%d",&n,&m); for(int i=1;i<=m;i++) { int A, B; scanf("%d%d",&A,&B); adj[A][B] = adj[B][A] = 1; } for(int i=1;i<=n;i++) { for(int j=i+1;j<=n;j++) { if(adj[i][j]) continue; if(!d[i] && !d[j]) d[i] = d[j] = true; } } int c = 0; for(int i=1;i<=n && c < n/3;i++) { if(!d[i]) {printf("%d ",i); c++;} } puts(""); }

Compilation message (stderr)

imp.cpp: In function 'int main()':
imp.cpp:8:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&n,&m);
                     ^
imp.cpp:11:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d",&A,&B);
                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...