链接:https://www.nowcoder.com/acm/contest/119/F来源:牛客网 Now HUST got a big land whose capacity is C to plant trees. We have n trees which could be plant in it. Each of the trees makes HUST beautiful which determined by the value of the tree. Also each of…
链接:https://www.nowcoder.com/acm/contest/141/A来源:牛客网 Eddy was a contestant participating in ACM ICPC contests. ACM is short for Algorithm, Coding, Math. Since in the ACM contest, the most important knowledge is about algorithm, followed by coding(impl…
链接:https://ac.nowcoder.com/acm/problem/17385来源:牛客网 题目描述 NIBGNAUK 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 is divisible by the sum of its digits.   We will not argue…
链接:https://www.nowcoder.com/acm/contest/142/G来源:牛客网 The mode of an integer sequence is the value that appears most often. Chiaki has n integers a1,a2,...,an. She woud like to delete exactly m of them such that: the rest integers have only one mode an…
链接:https://www.nowcoder.com/acm/contest/147/E 来源:牛客网 题目描述 Niuniu likes to play OSU! We simplify the game OSU to the following problem. Given n and m, there are n clicks. Each click may success or fail. For a continuous success sequence with length X,…
题意 给出一个矩阵,矩阵每行的和必须为2,且是一个主对称矩阵.问你大小为n的这样的合法矩阵有多少个. 分析 作者:美食不可负064链接:https://www.nowcoder.com/discuss/87226?type=101&order=0&pos=1&page=1来源:牛客网 题目给出的合法矩阵是一个类似与邻接矩阵的样式. 所以应该往这方面去考虑. 每行之和等于2 , 代表每个点都连有两条边,可以有重边 不能有自环. 这说明 每个点属于且仅属于一个环. 因为输入只有一个n…
链接:https://ac.nowcoder.com/acm/contest/558/C来源:牛客网 小猫在研究二元组. 小猫在研究最大值. 给定N个二元组(a1,b1),(a2,b2),…,(aN,bN),请你从中选出恰好K个,使得ai的最小值与bi的最小值之和最大. 请输出ai的最小值与bi的最小值之和 输入描述: 第一行两个正整数N,K,表示二元组数量与需要选的数量. 接下来N行,第i行两个正整数ai,bi. 输出描述: 一行一个正整数,表示最大的a_i的最小值与b_i的最小值之和. 示例…
C.幸运数字Ⅲ   链接:https://www.nowcoder.com/acm/contest/70/C来源:牛客网     这个题447和477是特殊的,其他的就没什么了.   代码: 1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 #include<cmath> 5 #include<algorithm> 6 using namespace std; 7 cons…
链接:https://ac.nowcoder.com/acm/contest/297/D 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 旅行到K国的小w发现K国有着很多物美价廉的商品,他想要买一些商品. 结果一掏钱包,包里只剩下n张K国的纸币了,说起来也奇怪,K国纸币并不像其他国家一样都是1元,5元,10元-而是各种奇怪的面值,所以找零就不是很方便. 已知商店里的商品价格…
链接:https://www.nowcoder.com/acm/contest/140/I来源:牛客网 White Cloud has a square of n*n from (1,1) to (n,n). White Rabbit wants to put in several cars. Each car will start moving at the same time and move from one side of one row or one line to the other…