Submission #29348

#TimeUsernameProblemLanguageResultExecution timeMemory
29348suhgyuho_williamUntitled (POI11_imp)C++14
9 / 100
1629 ms37224 KiB
#include <bits/stdc++.h> #include <unistd.h> #define pii pair<int,int> #define pll pair<lld,lld> #define pb push_back #define next nextt #define left leftt #define right rightt #define lld long long #define Inf 1000000000 #define Mod 1000000007 #define Linf 1000000000000000000LL #define get gett int N,M; int a[3002][3002]; bool check[3002]; int main(){ scanf("%d %d",&N,&M); for(int i=1; i<=M; i++){ int x,y; scanf("%d %d",&x,&y); a[x][y] = a[y][x] = 1; } memset(check,1,sizeof(check)); for(int i=1; i<=N; i++){ if(!check[i]) continue; for(int j=1; j<=N; j++){ if(!check[j]) continue; if(a[i][j] == 0 && i != j){ check[i] = check[j] = false; break; } } } for(int i=1; i<=N; i++) if(check[i]) printf("%d ",i); return 0; }

Compilation message (stderr)

imp.cpp: In function 'int main()':
imp.cpp:21:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&N,&M);
                      ^
imp.cpp:24:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d",&x,&y);
                       ^
#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...