05 2020 档案
摘要:坑比输入,比赛时没A掉可惜了 题目描述 这里有一棵树,每个点和每条边都存在一个价值。对于树上点对的价值,包括点对的起点和终点以及路径上边权值之和,不包括路径上其他点值。 求这颗树上最大的点对价值为多少。点对至少需要两个点。 输入描述: 输入t,代表有t组样例。每组样例第一行输入n,代表有n个点。接下
阅读全文
摘要:https://ac.nowcoder.com/acm/contest/5758#description 做的迟了+只会水题.jpg 剩下的咕咕咕慢慢补 A. 题目描述 这里有一棵树,每个点和每条边都存在一个价值。对于树上点对的价值,包括点对的起点和终点以及路径上边权值之和,不包括路径上其他点值。
阅读全文
摘要:During the quarantine, Sicromoft has more free time to create the new functions in "Celex-2021". The developers made a new function GAZ-GIZ, which inf
阅读全文
摘要:You've been in love with Coronavirus-chan for a long time, but you didn't know where she lived until now. And just now you found out that she lives in
阅读全文
摘要:Maria is the most active old lady in her house. She was tired of sitting at home. She decided to organize a ceremony against the coronavirus. She has
阅读全文
摘要:Due to the coronavirus pandemic, city authorities obligated citizens to keep a social distance. The mayor of the city Semyon wants to light up Gluharn
阅读全文
摘要:You are given an undirected graph without self-loops or multiple edges which consists of nn vertices and mm edges. Also you are given three integers n
阅读全文
摘要:The statement of this problem is the same as the statement of problem C1. The only difference is that, in problem C1, nn is always even, and in C2, nn
阅读全文
摘要:The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, nn is always even, and in C2, nn
阅读全文
摘要:You are given a string ss such that each its character is either 1, 2, or 3. You have to choose the shortest contiguous substring of ss such that it c
阅读全文
摘要:Polycarp has spent the entire day preparing problems for you. Now he has to sleep for at least aa minutes to feel refreshed. Polycarp can only wake up
阅读全文
摘要:Petya and Vasya are competing with each other in a new interesting game as they always do. At the beginning of the game Petya has to come up with an a
阅读全文
摘要:Young wilderness explorers set off to their first expedition led by senior explorer Russell. Explorers went into a forest, set up a camp and decided t
阅读全文
摘要:Let's define the following recurrence: an+1=an+minDigit(an)⋅maxDigit(an).an+1=an+minDigit(an)⋅maxDigit(an). Here minDigit(x)minDigit(x) and maxDigit(x
阅读全文
摘要:You are given an array aa of length nn consisting of zeros. You perform nn actions with this array: during the ii -th action, the following sequence o
阅读全文
摘要:You are given a board of size n×nn×n , where nn is odd (not divisible by 22 ). Initially, each cell of the board contains one figure. In one move, you
阅读全文
摘要:You are given two arrays aa and bb both consisting of nn positive (greater than zero) integers. You are also given an integer kk . In one move, you ca
阅读全文
摘要:You are given two integers nn and mm . You have to construct the array aa of length nn consisting of non-negative integers (i.e. integers greater than
阅读全文
摘要:实验目的: (1)掌握运算符函数重载为成员函数的方法 (2)掌握运算符函数重载为友元函数的方法 (3)掌握不同类型数据间的转换方法 实验内容: 假设square_matrix是n阶整型方阵,请实现下列运算: (1)cin>> square_matrix (2)cout<< square_matrix
阅读全文
摘要:There are nn models in the shop numbered from 11 to nn , with sizes s1,s2,…,sns1,s2,…,sn . Orac will buy some of the models and will arrange them in t
阅读全文
摘要:Orac is studying number theory, and he is interested in the properties of divisors. For two positive integers aa and bb , aa is a divisor of bb if and
阅读全文
摘要:Hilbert's Hotel is a very unusual hotel since the number of rooms is infinite! In fact, there is exactly one room for every integer, including zero an
阅读全文
摘要:A card pyramid of height 11 is constructed by resting two cards against each other. For h>1h>1, a card pyramid of height hh is constructed by placing
阅读全文
摘要:You are given a special jigsaw puzzle consisting of n⋅mn⋅m identical pieces. Every piece has three tabs and one blank, as pictured below. The jigsaw p
阅读全文
摘要:A. Sum of Round Numbers 把一个数拆成几个整十/百/千...的数的和。 #include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int i,num,ans=0;
阅读全文
摘要:In order to get from one of the F (1 <= F <= 5,000) grazing fields (which are numbered 1..F) to another field, Bessie and the rest of the herd are for
阅读全文
摘要:题目描述 There are exactly nnn towns in Byteotia. Some towns are connected by bidirectional roads. There are no crossroads outside towns, though there may
阅读全文
摘要:题目描述 幼儿园里有 NNN 个小朋友,lxhgww\text{lxhgww}lxhgww 老师现在想要给这些小朋友们分配糖果,要求每个小朋友都要分到糖果。 但是小朋友们也有嫉妒心,总是会提出一些要求,比如小明不希望小红分到的糖果比他的多,于是在分配糖果的时候,lxhgww\text{lxhgww}
阅读全文
摘要:A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools t
阅读全文
摘要:题目背景 缩点+DP 题目描述 给定一个 nnn 个点 mmm 条边有向图,每个点有一个权值,求一条路径,使路径经过的点权值之和最大。你只需要求出这个权值和。 允许多次经过一条边或者一个点,但是,重复经过的点,权值只计算一次。 输入格式 第一行两个正整数 n,mn,mn,m 第二行 nnn 个整数,
阅读全文
摘要:Phoenix has decided to become a scientist! He is currently investigating the growth of bacteria. Initially, on day 11, there is one bacterium with mas
阅读全文
摘要:Phoenix has a string ss consisting of lowercase Latin letters. He wants to distribute all the letters of his string into kk non-empty strings a1,a2,…,
阅读全文
摘要:Phoenix loves beautiful arrays. An array is beautiful if all its subarrays of length kk have the same sum. A subarray of an array is any sequence of c
阅读全文
摘要:Phoenix has nn coins with weights 21,22,…,2n21,22,…,2n. He knows that nn is even. He wants to split the coins into two piles such that each pile has e
阅读全文
摘要:比赛链接:https://www.jisuanke.com/contest/8290?view=challenges A. You are playing a game in which a group of players take turns saying animal names. The a
阅读全文