03 2016 档案
摘要:题目链接:点击打开链接题意: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条边的无向无环图,在尽量少的节点上放灯,使得所有边都被照亮,每盏灯将照亮以它为一个端点的所有边。在灯的总数最小的前提下,被两盏灯同时照亮的边数应尽量大。思路:无向无环图的另一个说法是“森林”,即由多棵树组成,我们可以先算一棵...
阅读全文
摘要:DescriptionLet us begin with a positive integer N and find the smallest positive integer which doesn't divide N. If we repeat the proc...
阅读全文
摘要:DescriptionThe distance between two integers is defined as the sum of the absolute result of subtracting their digits. For example, th...
阅读全文
摘要:DescriptionMirko has a chessboard with N rows and just three columns. Slavica has written an integer on each field. Mirko has K domino...
阅读全文
摘要:DescriptionMirko is hungry as a bear, scratch that, programmer and has stumbled upon a local restaurant. The restaurant offers N meals...
阅读全文
摘要:In this problem you have to simulate the workflow of one-thread server. There are n queries to process, the i-th will be received at m...
阅读全文
摘要:Problem DescriptionFor a decimal number x with n digits (AnAn-1An-2 ... A2A1), we define its weight as F(x) = An * 2n-1 + An-1 * 2n-2 ...
阅读全文
摘要:Problem Description#define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire description is...
阅读全文
摘要:Problem DescriptionIn order to remember history, King plans to play losephus problem in the parade gap.He calls n(1≤n≤5000) soldiers, ...
阅读全文
摘要:Problem DescriptionA list of n integers are given. For an integer x you can do the following operations:+ let the binary representatio...
阅读全文
摘要:Little Petya is now fond of data compression algorithms. He has already studied gz, bz, zip algorithms and many others. Inspired by th...
阅读全文
摘要:题目:点击打开链接题意:两个人做游戏,共有n个数,每个人可以任选一端取任意多连续的数,问两个人都想拿最多的情况下,先手最多比后手多拿多少分数。思路:这题一开始想到的是用dp[i][j]表示区间[i,j]内先手最多比后手多拿多少分数,那么状态转移方程为dp[i][j]=...
阅读全文
摘要:DescriptionThe 3rd round of COCI is already here! In order to bet on predict the scores, we have assumed the following: If contestant ...
阅读全文
摘要:DescriptionSample Input6JANJETINA51 J1 A6 N6 I5 ESample Output10211题意:给你一个长度小于等于10^6的字符串,然后每次让它循环铺盖,构成层数为n的塔,让你求得第i层塔中某个字符的个数。思路:首先要注意...
阅读全文
摘要:Problem DescriptionThere is a path graph G=(V,E) with n vertices. Vertices are numbered from 1 to n and there is an edge with unit len...
阅读全文
摘要:做了三题表达式的转换题,都是先把中缀表达式转换为后缀表达式,然后再计算。zjnu1069 表达式的转换——中级Description平常我们书写的表达式称为中缀表达式,因为它将运算符放在两个操作数中间,许多情况下为了确定运算顺序,括号是不可少的,而中缀表达式就不必用括...
阅读全文
摘要:DescriptionPetar is throwing a birthday party and he decided to invite some of the employees of his company where he is the CEO. Each ...
阅读全文
摘要:DescriptionMirko is a huge fan of chess and programming, but typical chess soon became boring for him, so he started having fun with r...
阅读全文
摘要:Description"Hey! I have an awesome task with chameleons, 5 th task for Saturday’s competition.""Go ahead. . . "(...)“That’s too diffic...
阅读全文
摘要:DescriptionThere are eight planets and one planetoid in the Solar system. It is not a well known fact that there is a secret planet S4...
阅读全文
摘要:Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it ...
阅读全文
摘要:Problem Description 单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11...
阅读全文
摘要:Problem DescriptionA wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and...
阅读全文
摘要:DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, ...
阅读全文
摘要:Problem DescriptionGiven two matrices A and B of size n×n, find the product of them.bobo hates big integers. So you are only asked to ...
阅读全文
摘要:DescriptionYou are given N sets, the i-th set (represent by S(i)) have C(i) element (Here "set" isn't entirely the same as the "set" d...
阅读全文
摘要:You're given a matrix A of size n × n.Let's call the matrix with nonnegative elements magic if it is symmetric (so aij = aji), aii = 0...
阅读全文
摘要:A thief made his way to a shop.As usual he has his lucky knapsack with him. The knapsack can contain k objects. There are n kinds of p...
阅读全文
摘要:You are given array a with n elements and the number m. Consider some subsequence of a and the value of least common multiple (LCM) of...
阅读全文
摘要:You're given a list of n strings a1, a2, ..., an. You'd like to concatenate them together in some order such that the resulting string...
阅读全文
摘要:Problem DescriptionCRB has N different candies. He is going to eat K candies.He wonders how many combinations he can select.Can you an...
阅读全文
摘要:Problem DescriptionThe Sky is Sprite.The Birds is Fly in the Sky.The Wind is Wonderful.Blew Throw the TreesTrees are Shaking, Leaves a...
阅读全文