摘要:
样例输入 3 crm:2 git:3 game 4 hr 1 crm:2 it 3 crm:1 git:1 game dev 2 git:3 game qa 1 git:2 3 alice 1 hr bob 2 it qa charlie 1 dev 9 alice game alice crm:2 阅读全文
摘要:
使用并查集,当能够使1和n在同一个连通块的时候 就可以退出,又因为是求最长时间,也就是当前这个子生成树的最大边 也就是刚好使得1和n联通时加入的那条边的边权 使用克鲁斯塔尔算法即可 #include<bits/stdc++.h> using namespace std; int ans = 0; v 阅读全文
摘要:
因为每个球最终的相对位置的序号是不变的 而且碰撞可以看成穿过,所以直接可以计算所有的最终位置 和树上的蚂蚁这题很像 #include <bits/stdc++.h> using namespace std; int main(int argc, char** argv) { int n,L,t; c 阅读全文
摘要:
机器学习派上了用场 #include<bits/stdc++.h> using namespace std; int getsign(long long x){ return x<0?-1:1; } int main(int argc, char const *argv[]) { int n; in 阅读全文