Polycarp is sad — New Year is coming in few days but there is still no snow in his city. To bring himself New Year mood, he decided to decorate his house with some garlands. The local store introduce
This way 题意: 现在有n个点,第i个点的权值为 2 i 2^i 2i,现在有n-1条边使得这些点组成一棵树,边的权值是它连接的子树的权值和。现在按照边的权值从大到小给你每条边的父节点,让你输出根节点的下标以及输出输入顺序每条边所连接的两个点 题解: 自顶向下我觉得做不了,但是反过来一想自底向上很简单,首先我们处理出所有未出现过的点是什么,然后最后一条边连接的一定是最小的那个点。有
题意:给两个由小写字母组成的字符串,长度分别为n,m (1 <= n, m <= 1000),代表有n张纸,一个要做成的m的花环,每个字符串的每个不一样的小写字母代表一种颜色,问最多能用多少张纸做成符合要求的花环,纸可以裁剪。 题目链接:http://codeforces.com/problemset/problem/408/B ——>>起床秒一题。。 统计字母出现的次数。。扫描26个字母的
题目链接:https://codeforc.es/contest/1286/problem/A Vadim loves decorating the Christmas tree, so he got a beautiful garland as a present. It consists of n light bulbs in a single row. Each bulb has a nu