27分求助w刚学图论没多久写的挺答辩的;w;;;;;;;;;;;

P1636 Einstein学画画(数据有误)

@[biggay002](/user/373334) 你在写什么?这不是欧拉路模板题吗
by 北文 @ 2023-07-26 23:24:31


@[北文](/user/53769) a?????????我看是图论的我就写了一下;w;欧拉路好像还不会qnq
by biggay002 @ 2023-07-27 21:47:46


@[biggay002](/user/373334) 这个题看每个点的度判断需要几条欧拉路啊
by 北文 @ 2023-07-28 07:11:42


这是什么?
by poor_OIer @ 2023-08-30 20:10:29


@[biggay002](/user/373334) ```cpp #include <iostream> using namespace std; int a[1001]; int main() { int n, m; cin >> n >> m; int x, y; for (int i = 1; i <= m; i++) { cin >> x >> y; a[x]++; a[y]++; } int cnt = 0; for (int i = 1; i <= n; i++) { if (a[i] % 2 != 0) { cnt++; } } if (cnt == 0 || cnt == 2) { cout << 1; } else { cout << cnt / 2; } return 0; } ``` 这样写,可以[AC](https://www.luogu.com.cn/record/123402382)的。
by Dumbo @ 2023-08-31 16:18:19


一笔画问题只要找出由几个点伸出来了奇数条线,如果是0个或2个,就可以一笔画,否则就需要 个数 $÷2$ 画。
by yangzishuo0418 @ 2023-10-16 19:10:19


|