# 10596-morning walk // Euler's loop

Source: Internet
Author: User
`/* The describe is not clear */# include <cstdio> # include <cstring> using namespace STD; const int maxn = 205; int degree [maxn]; int f [maxn]; int N, R; int find (int x) {If (X! = F [x]) {f [x] = find (F [x]);} return f [X];} int main () {While (scanf ("% d", & N, & R )! = EOF) {If (r = 0) {printf ("Not possible \ n"); continue;} // initilize memset (degree, 0, sizeof (degree )); for (INT I = 0; I <= N; I ++) f [I] = I; // make a graph and record the degrees for (INT I = 0; I <r; I ++) {int A, B; scanf ("% d", & A, & B); degree [a] ++; degree [B] ++; If (find ()! = Find (B) f [find (a)] = find (B);} // judge whether the graph is conneted bool OK = true; Int J = 0; for (j = 0 ;! Degree [J]; j ++) for (INT I = J + 1; I <n; I ++) {If (degree [I] & find (j )! = Find (I) {OK = true; break;} If (OK) {for (INT I = 0; I <n; I ++) {If (degree [I] % 2) {OK = false; break ;}} if (OK) printf ("Possible \ n "); else printf ("Not possible \ n");} return 0 ;}`

Related Keywords:

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

## A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

• #### Sales Support

1 on 1 presale consultation

• #### After-Sales Support

24/7 Technical Support 6 Free Tickets per Quarter Faster Response

• Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.