题目描述 在n个人中,某些人的银行账号之间可以互相转账。这些人之间转账的手续费各不相同。给定这些人之间转账时需要从转账金额里扣除百分之几的手续费,请问A最少需要多少钱使得转账后B收到100元。 ...
题目描述 给一个长度为n的数列,我们需要找出该数列的一个子串,使得子串平均数最大化,并且数列长度>=m。 ...
题目描述 Farmer John has devised a brilliant method to paint the long fence next to his barn (think of the fence as a one-dimensional number line). He simply attaches a paint brus…
题目描述 有一家世界级大企业,他们经过调查,发现了一个奇特的现象,竟然在自己的公司里,有超过一半的雇员,他们的工资完全相同! 公布了这项调查结果后,众多老板对于这一现象很感兴趣,他们发现在自己的公司也存在有这样的现象——超过一半的雇员工资都是x。老板们都很想知道这个x是多少,请你帮忙计算一下。 ...
题目描述 一本书的页码是从1—n编号的连续整数:1,2,3,…,n。请你求出全部页码中所有单个数字的和,例如第123页,它的和就是1+2+3=6。 ...
One of my friends is always drunk. So, sometimes I get a bit confused whether he is drunk or not. So, one day I was talking to him, about his drinks! He began to describe his …
I am going to my home. There are many cities and many bi-directional roads between them. The cities are numbered from 0 to n-1 and each road has a cost. There are m roads. You…
题目描述 Description 相信大家都玩过扫雷的游戏。那是在一个n*m的矩阵里面有一些雷,要你根据一些信息找出雷来。万圣节到了,“余”人国流行起了一种简单的扫雷游戏,这个游戏规则和扫雷一样,如果某个格子没有雷,那么它里面的数字表示和它8连通的格子里面雷的数目。现在棋盘是n×2的,第一列里面某些格子是雷,而第二列没有雷, 由于第一列的雷可能有多…
time limit per test: 0.25 sec. memory limit per test: 4096 KB There is a group of N (2<=N<=1000) people which are numbered 1 through N, and everyone of them has not less…
time limit per test: 0.25 sec. memory limit per test: 4096 KB First year of new millenium is gone away. In commemoration of it write a program that finds the name of the day o…