摘要: https://ac.nowcoder.com/acm/contest/5634/D 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=5e5+10; 4 int vis[maxn]; 5 int fa[maxn]; 阅读全文
posted @ 2020-05-13 22:16 古比 阅读(133) 评论(0) 推荐(0) 编辑
摘要: https://ac.nowcoder.com/acm/contest/5634/C 想一想就能发现这是一道质因素分解的模板题; 我们只要求出该数字由多少个质因素组成,然后判断即可; 1 #include<bits/stdc++.h> 2 using namespace std; 3 int mai 阅读全文
posted @ 2020-05-13 21:40 古比 阅读(253) 评论(0) 推荐(0) 编辑
摘要: https://ac.nowcoder.com/acm/contest/5634/B 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 ll gcd(ll a,ll b) 5 { 6 return b 阅读全文
posted @ 2020-05-13 20:47 古比 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 链接:https://ac.nowcoder.com/acm/contest/5086/C 题意+思路:给出一棵树,给出三个点tmp1,tmp2,tmp3; 当tmp1跟tmp3最近祖先为1时: if(LCA(tmp1,tmp3)==1){ if(judgea<judgeb) printf("YES 阅读全文
posted @ 2020-05-13 18:09 古比 阅读(96) 评论(0) 推荐(0) 编辑