版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出版、作者信息和本声明。否则将追究法律责任。 http://blog.csdn.net/topmvp - topmvp *Find out what you should clean, when, and how *Dump programs you don't need, archive data, and bring o
During cleaning the coast, Alice found 𝑛 piles of stones. The 𝑖-th pile has 𝑎𝑖 stones. Piles 𝑖 and 𝑖+1 are neighbouring for all 1≤𝑖≤𝑛−1. If pile 𝑖 becomes empty, piles 𝑖−1 and 𝑖+1 doesn’t
传送门 题意 分析 分析起来有点前缀和的味道? 假设我们要去交换 i i i和 i + 1 i + 1 i+1,那么,我们考虑 1 − i − 1 1 - i - 1 1−i−1区间最后剩下的数 x x x和 i + 2 − n i + 2 - n i+2−n区间最后剩下的数 y y y,只要能够保证 a [ i + 1 ] − x = = a [ i ] − y a[i + 1] -
文章目录 C1475D Cleaning the Phone 题解Cleaning the Phone题面翻译题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1 提示算法:贪心代码: C1475D Cleaning the Phone 题解 link Cleaning the Phone 题面翻译 题目大意: 有 n n n 个物品和一个最低价值 m m
题目: Polycarp often uses his smartphone. He has already installed n applications on it. Application with number i takes up ai units of memory. Polycarp wants to free at least m units of memory (by rem
Problem 2200 cleaning Problem Description N个人围成一圈在讨论大扫除的事情,需要选出K个人。但是每个人与他距离为2的人存在矛盾,所以这K个人中任意两个人的距离不能为2,他们想知道共有多少种方法。 Input 第一行包含一个数T(T<=100),表示测试数据的个数。 接下来每行有两个数N,K,N表示人数,K表示需要的人数(1<=N<=10