forked from oeddyo/algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10596.cpp
More file actions
37 lines (32 loc) · 672 Bytes
/
10596.cpp
File metadata and controls
37 lines (32 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <string.h>
using namespace std;
const int MAXN = 300;
int N,R;
int degree[MAXN];
int g[MAXN][MAXN];
int main(){
while( cin>>N>>R){
int a,b;
memset(degree,0,sizeof(degree));
for(int i=0; i<R; i++){
cin>>a>>b;
degree[a]++;
degree[b]++;
g[a][b]++;
g[b][a]++;
}
int not_ok = 0;
for(int i=0; i<N; i++){
if(degree[i]%2!=0){
not_ok++;
}
}
if(not_ok<=2){
cout<<"Possible"<<endl;
}else{
cout<<"Not Possible"<<endl;
}
}
return 0;
}