摘要:
最近被锤爆了啊,不能再划水了qwq (一)最大公约数 (1)Euclid算法:辗转相除法(核心就一句:return a%b==0?b:gcd(a%b,b); #include <bits/stdc++.h> using namespace std; int gcd(int a,int b) { re 阅读全文
摘要:
F. Leaf Sets 给定一棵n个点的树,将叶子节点分为数个集合使集合里点对最长距离不超过k,求最少集合数。 F. Leaf Sets 给定一棵n个点的树,将叶子节点分为数个集合使集合里点对最长距离不超过k,求最少集合数。 You are given an undirected tree, co 阅读全文
摘要:
D. Fafa and Ancient Alphabet (简洁题意请往下翻) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output 阅读全文