摘要:
Consider the decimal presentation of an integer. Let's call a number d-magic if digit d appears in decimal presentation of the number ... 阅读全文
摘要:
Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to prac... 阅读全文
摘要:
题目链接:点击打开链接题意:n台机器连成一个树状网络,其中叶节点是客户端,其他节点是服务器,目前有一台服务器s正在提供服务。让你在其他服务器上也安排同样的服务,使得每台客户端到最近服务器的距离不超过k,而且要使服务器尽量少,问最少要设置多少台服务器。思路:我们先把s看... 阅读全文
摘要:
Binary-coded decimal (BCD) is an encoding for decimal numbers in which each digit is represented by its own binary sequence. To encode... 阅读全文
摘要:
Vasya has decided to build a zip-line on trees of a nearby forest. He wants the line to be as long as possible but he doesn't remember... 阅读全文
摘要:
DescriptionSample Input4 11 2 3 4Sample Output4.000000题意:给你n个数,让你找到长度大于等于k的连续串的最大平均值。思路:我们可以二分答案,然后先把每一个数减去二分的平均值,记录前缀和sum[i],用从k开始循环,... 阅读全文
摘要:
题目描述:在一个M * N的矩阵中,所有的元素只有0和1,从这个矩阵中找出一个面积最大的全1子矩阵,所谓最大是指元素1的个数最多。输入:输入可能包含多个测试样例。对于每个测试案例,输入的第一行是两个整数m、n(1#include#include#include#inc... 阅读全文
摘要:
DescriptionMirko is playing with stacks. In the beginning of the game, he has an empty stack denoted with number 0. In theith step of ... 阅读全文
摘要:
DescriptionLittle Bob is a famous builder. He bought land and wants to build a house. Unfortunately, the problem is theland’s terrain,... 阅读全文
摘要:
题目链接:点击打开链接题意:给你一个n个点m条边的无向无环图,在尽量少的节点上放灯,使得所有边都被照亮,每盏灯将照亮以它为一个端点的所有边。在灯的总数最小的前提下,被两盏灯同时照亮的边数应尽量大。思路:无向无环图的另一个说法是“森林”,即由多棵树组成,我们可以先算一棵... 阅读全文