![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ZOJ
Dopuu
这个作者很懒,什么都没留下…
展开
-
ZOJ
ZOJ——2833并查集的寻根和合并操作#include <iostream>using namespace std;int friends[100005];//寻找根节点int find(int x){ while(friends[x]>0) x=friends[x]; return x;}//合并两节点void Union(int x, int y){ int r1=find(x); int r2=find(y)原创 2021-04-14 21:10:27 · 102 阅读 · 0 评论 -
2021-03-12
【ZOJ】1383—Binery Numbers题目原题:Given a positive integer n, print out the positions of all 1’s in its binary representation. The position of the least significant bit is 0.ExampleThe positions of 1’s in the binary representation of 13 are 0, 2, 3.TaskWr原创 2021-03-12 19:13:30 · 131 阅读 · 0 评论