05 2020 档案

摘要:https://vjudge.net/contest/375686#overview A - Sorted Adjacent Differences 从小到大排序,最后一个减最前面一个的差最大,并且倒数第二个减去第一个比刚刚的差值小,循环着输出就行了 #include <iostream> #inc 阅读全文
posted @ 2020-05-29 13:25 IIlIlIlI 阅读(118) 评论(0) 推荐(0)
摘要:A - Candies 大意就是 x(1 + .... 2 ^ (k - 1) ) = x * (2 ^ k - 1) = n; 求x 所以 x = n / (2 ^ k - 1);//写个快速幂就可以求解了 #include <iostream> using namespace std; //x 阅读全文
posted @ 2020-05-24 21:17 IIlIlIlI 阅读(137) 评论(0) 推荐(0)
摘要:A.Phoenix and Balance 题意:给一组数2^1,2^2,……,2^n,然后平均分为两组,使其两组和的差绝对值最小 注意到2 ^ (n+1) = 2^0 + ... 2 ^n +1; 所以 a[n] = a[0] + .. a[n-1] + 2; 含a[n]的一方尽可能选小的就可 # 阅读全文
posted @ 2020-05-20 15:17 IIlIlIlI 阅读(123) 评论(0) 推荐(0)