随笔分类 - 思维
摘要:题目链接: http://codeforces.com/problemset/problem/1225/C 思路 把所有的p移回左边得到一个数, 此时它应该有多个2k 组成 然后我们就可以数出这个数的二进制及有多少个1 判断它是不是符合题意 Code
阅读全文
摘要:题面 Ted is a employee of Always Cook Mushroom (ACM). His boss Matt gives him a pack of mushrooms and ask him to grade each mushroom according to its we
阅读全文
摘要:思路 根据物理规律, 按照加速度降序即是最优解. 分别算出并作差即可 Code c++ include using namespace std; struct node { double a, t; bool operator rhs.a; } }; int main() { int n; scan
阅读全文
摘要:You are given an array a consisting of n integers a1,a2,…,an. You want to split it into exactly k non-empty non-intersecting subsegments such that eac
阅读全文