摘要:
题目描述 Farmer John owns Ncows with spots and N cows without spots. Having just completed a course in bovine genetics, he is convinced that the spots on 阅读全文
摘要:
Description 小 C 最近学了很多最小生成树的算法,Prim 算法、Kurskal 算法、消圈算法等等。 正当小 C 洋洋得意之时,小 P 又来泼小 C 冷水了。小 P 说,让小 C 求出一个无向图的次小生成树,而且这个次小生成树还得是严格次小的,也就是说: 如果最小生成树选择的边集是 E 阅读全文
摘要:
Description Given n, calculate the sum LCM(1,n) + LCM(2,n) + .. + LCM(n,n), where LCM(i,n) denotes the Least Common Multiple of the integers i and n. 阅读全文
摘要:
~~手速选手成功混进rated only里面的前30名,但是总排名就到110+了...~~ A Double Helix B ATCoder 所以转移的时候再多枚举一个第i 3位的字符,就可以$O(5^4n)$解决这题了。注意要特判$n\leq 2$的情况。 cpp include define l 阅读全文
摘要:
自闭了。 "神仙出题人" A cpp include using namespace std; define N 100010 int n, a[N]; bool check(int x) { int t = sqrt(x); return t t != x; } int main() { scan 阅读全文