Submission #951157

#TimeUsernameProblemLanguageResultExecution timeMemory
951157WarinchaiRonald (COCI17_ronald)C++14
105 / 120
32 ms6228 KiB
#include<bits/stdc++.h> using namespace std; int vis[1005]; int edge[1005][1005]; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n;cin>>n; int m;cin>>m; for(int i=1;i<=m;i++){ int a,b;cin>>a>>b; edge[a][b]=1; edge[b][a]=1; } int check=1; for(int i=1;i<=n;i++){ if(!vis[i]){ vis[i]=1; vector<int>v; for(int j=1;j<=n;j++)if(edge[i][j])v.push_back(j),vis[j]=1; for(auto x:v){ for(int k=1;k<=n;k++){ if(k!=x&&k!=i){ if(edge[x][k]!=edge[i][k]){ check=0; break; } } } if(!check)break; } } if(!check)break; } if(check)cout<<"DA"; else cout<<"NE"; }
#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...