随笔分类 - 思维题
摘要:Problem Description There are n stones numbered from 1 to n.The weight of the i-th stone is i kilograms. We divide the stones into k groups.Each group
阅读全文
摘要:Tom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are nn
阅读全文
摘要:Vus the Cossack has nn real numbers aiai. It is known that the sum of all numbers is equal to 00. He wants to choose a sequence bb the size of which i
阅读全文
摘要:如果两个集合存储颜色的情况相同,说明这两个在k个图中都是在一个集合的 学到的点:用map,将vector映射一个整数时,只有vector后面的邻接的数据都一样时,才认为两个vector一样 代码:
阅读全文
摘要:看从当前点到到不是1的点的位置,从奇偶性判断 代码:
阅读全文
摘要:思路:上下扫,注意一点细节处理就好了 代码:
阅读全文
摘要:A. Telephone Number A telephone number is a sequence of exactly 11 digits, where the first digit is 8. For example, the sequence 80011223388 is a tele
阅读全文
摘要:A. Remainder output standard output output standard output output You are given a huge decimal number consisting of nn digits. It is guaranteed that t
阅读全文
摘要:恢复内容开始 We guessed some integer number xx. You are given a list of almost all its divisors. Almost all means that there are all divisors except 11and x
阅读全文
摘要:Description 又到了一年一度ACMer暑期留校集训的日子了,目前一共有2n+1个小萌新报名参加暑期集训,其中2n个是帅哥,只有1个萌妹子,这是多么的悲催!由于暑期训练强度大,坚持下来可不是一件容易的事情,DHG学长想到了一个巧妙的方法,两个人组成一队,两人互相鼓励,互相监督,直到集训顺利完
阅读全文
摘要:Let’s start with a very classical problem. Given an array a[1…n] of positive numbers, if the value of each element in the array is distinct, how to fi
阅读全文
摘要:There are n integers a 1,a 2,…,a n-1,a n in the sequence A, the sum of these n integers is larger than zero. There are n integers b 1,b 2,…,b n-1,b n
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/893/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/893/D来源:牛客网 题目描述 有n堆石子排成一排,第i堆石子有aiai个石子。 每次,你可以选择任意相邻的两堆石子进行合并,合并后的石子数量为两堆石子的和,消耗的体力等价于两堆石子中石子数少的那个。 请问,将所有的石子
阅读全文
摘要:题目描述 小明喜欢在一个围棋网站上找别人在线对弈。这个网站上所有注册用户都有一个积分,代表他的围棋水平。小明发现网站的自动对局系统在匹配对手时,只会将积分差恰好是K的两名用户匹配在一起。如果两人分差小于或大于K,系统都不会将他们匹配。现在小明知道这个网站总共有N名用户,以及他们的积分分别是A1, A
阅读全文
摘要:Simon has a prime number x and an array of non-negative integers a1, a2, ..., an. Simon loves fractions very much. Today he wrote out number on a piec
阅读全文
摘要:Consider the natural numbers from 1 to N. By associating to each number a sign (+ or -) and calculating the value of this expression we obtain a sum S
阅读全文
摘要:A. Stock Arbitraging 直接上代码: B. Tiling Challenge 找一下就行了 代码: C. Prefix Sum Primes 思维+构造也很好想 代码;
阅读全文
摘要:年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他...
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/543/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述有一只可爱的兔子被困...
阅读全文