01 2020 档案
摘要:题目描述 金明今天很开心,家里购置的新房就要领钥匙了,新房里有一间金明自己专用的很宽敞的房间。更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要不超过NN元钱就行”。今天一早,金明就开始做预算了,他把想买的物品分为两类:主件与附件,附件是从属于某个主件的,下表就是一
阅读全文
摘要:单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数! 什么
阅读全文
摘要:杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属
阅读全文
摘要:有n个任务,每个任务有一个截止时间,超过截止时间一天,要扣一个分。求如何安排任务,使得扣的分数最少。Input有多组测试数据。第一行一个整数表示测试数据的组数第一行一个整数n(1<=n<=15)接下来n行,每行一个字符串(长度不超过100)表示任务的名称和两个整数,分别表示任务的截止时间和完成任务需
阅读全文
摘要:题目描述 在N×N的棋盘里面放K个国王,使他们互不攻击,共有多少种摆放方案。国王能攻击到它上下左右,以及左上左下右上右下八个方向上附近的各一个格子,共8个格子。 注:数据有加强(2018/4/25) 输入格式 只有一行,包含两个数N,K ( 1 <=N <=9, 0 <= K <= N * N) 输
阅读全文
摘要:题目描述 Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy
阅读全文
摘要:一组研究人员正在设计一项实验,以测试猴子的智商。他们将挂香蕉在建筑物的屋顶,同时,提供一些砖块给这些猴子。如果猴子足够聪明,它应当能够通过合理的放置一些砖块建立一个塔,并爬上去吃他们最喜欢的香蕉。 研究人员有n种类型的砖块,每种类型的砖块都有无限个。第i块砖块的长宽高分别用xi,yi,zi来表示。
阅读全文
摘要:Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now y
阅读全文
摘要:题目背景 现在乐斗有活动了!每打一个人可以获得5倍经验!absi2011却无奈的看着那一些比他等级高的好友,想着能否把他们干掉。干掉能拿不少经验的。 题目描述 现在absi2011拿出了x个迷你装药物(嗑药打人可耻….),准备开始与那些人打了 由于迷你装一个只能管一次,所以absi2011要谨慎的使
阅读全文
摘要:Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irrever
阅读全文
摘要:Farmer John recently bought another bookshelf for the cow library, but the shelf is getting filled up quite quickly, and now the only available space
阅读全文
摘要:Description 有两棵APP树,编号为1,2.每一秒,这两棵APP树中的其中一棵会掉一个APP.每一秒,你可以选择在当前APP树下接APP,或者迅速移动到另外一棵APP树下接APP(移动时间可以忽略不计),但由于却乏锻炼,你最多移动W次.问在T秒内,你最多能收集多少个APP.假设你开始站在1
阅读全文
摘要:在一年前赢得了小镇的最佳草坪比赛后,FJ变得很懒,再也没有修剪过草坪。现在,新一轮的最佳草坪比赛又开始了,FJ希望能够再次夺冠。然而,FJ的草坪非常脏乱,因此,FJ只能够让他的奶牛来完成这项工作。FJ有N(1 <= N <= 100,000)只排成一排的奶牛,编号为1...N。每只奶牛的效率是不同的
阅读全文
摘要:A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different h
阅读全文
摘要:纯板子题,入队时保证单调性,即单调栈,出队保证题目条件,本题即窗口长度k,在入队出队时都可以维护信息 const int maxm = 1e6+5; int buf[maxm], maxq[maxm], minq[maxm], ans1[maxm], ans2[maxm]; int main() {
阅读全文
摘要:typedef long long LL; typedef pair<LL, LL> PLL; const int maxm = 1e4+5; const int maxn = 1e7+5; int ans[maxn]; int head[maxm], cnt, siz[maxm], mxson[m
阅读全文
摘要:题目背景 蕾米莉亚的红雾异变失败后,很不甘心。 题目描述 经过上次失败后,蕾米莉亚决定再次发动红雾异变,但为了防止被灵梦退治,她决定将红雾以奇怪的阵势释放。 我们将幻想乡看做是一个n*m的方格地区,一开始没有任何一个地区被红雾遮盖。蕾米莉亚每次站在某一个地区上,向东南西北四个方向各发出一条无限长的红
阅读全文
摘要:题目描述 聪聪和可可是兄弟俩,他们俩经常为了一些琐事打起来,例如家中只剩下最后一根冰棍而两人都想吃、两个人都想玩儿电脑(可是他们家只有一台电脑)……遇到这种问题,一般情况下石头剪刀布就好了,可是他们已经玩儿腻了这种低智商的游戏。 他们的爸爸快被他们的争吵烦死了,所以他发明了一个新游戏:由爸爸在纸上画
阅读全文
摘要:Give a tree with n vertices,each edge has a length(positive integer less than 1001).Define dist(u,v)=The min distance between node u and v.Give an int
阅读全文
摘要:Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going th
阅读全文
摘要:A positive integer aa is given. Baron Munchausen claims that he knows such a positive integer nn that if one multiplies nn by aa, the sum of its digit
阅读全文
摘要:Bizon the Champion isn't just charming, he also is very smart. While some of us were learning the multiplication table, Bizon the Champion had fun in
阅读全文
摘要:A string is binary, if it consists only of characters "0" and "1". String v is a substring of string w if it has a non-zero length and can be read sta
阅读全文
摘要:Berland starts to seize the initiative on the war with Flatland. To drive the enemy from their native land, the berlanders need to know exactly how ma
阅读全文
摘要:Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choo
阅读全文
摘要:Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical, emotiona
阅读全文
摘要:People are different. Some secretly read magazines full of interesting girls' pictures, others create an A-bomb in their cellar, others like using Win
阅读全文
摘要:This problem is based on an exercise of David Hilbert, who pedagogically suggested that one study the theory of 4n+1 numbers. Here, we do only a bit o
阅读全文
摘要:Your task in this problem is to determine the number of divisors of Cnk. Just for fun -- or do you need any special reason for such a useful computati
阅读全文
摘要:Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following: Choo
阅读全文
摘要:The Euler function phi is an important kind of function in number theory, (n) represents the amount of the numbers which are smaller than n and coprim
阅读全文
摘要:Chiaki has an n × m matrix A. Rows are numbered from 1 to n from top to bottom and columns are numbered from 1 to m from left to right. The element in
阅读全文
摘要:Given A,B,C, You should quickly calculate the result of A^B mod C. (1<=A,C<=1000000000,1<=B<=10^1000000). Input There are multiply testcases. Each tes
阅读全文
摘要:A lattice point (x, y) in the first quadrant (x and y are integers greater than or equal to 0), other than the origin, is visible from the origin if t
阅读全文
摘要:两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对
阅读全文
摘要:对于序列A,它的逆序对数定义为满足i<j,且Ai>Aj的数对(i,j)的个数。给1到n的一个排列,按照某种顺序依次删 除m个元素,你的任务是在每次删除一个元素之前统计整个序列的逆序对数 Input 输入第一行包含两个整数n和m,即初始元素的个数和删除的元素个数。 以下n行每行包含一个1到n之间的正整
阅读全文
摘要:维护一个W*W的矩阵,初始值均为S.每次操作可以增加某格子的权值,或询问某子矩阵的总权值.修改操作数M<=160000,询问数Q<=10000,W<=2000000. Input 第一行两个整数,S,W;其中S为矩阵初始值;W为矩阵大小接下来每行为一下三种输入之一(不包含引号):"1 x y a""
阅读全文
摘要:有n朵花,每朵花有三个属性:花形(s)、颜色(c)、气味(m),用三个整数表示。 现在要对每朵花评级,一朵花的级别是它拥有的美丽能超过的花的数量。 定义一朵花A比另一朵花B要美丽,当且仅Sa>=Sb,Ca>=Cb,Ma>=Mb。 显然,两朵花可能有同样的属性。需要统计出评出每个等级的花的数量。 In
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/102/C来源:牛客网 题目描述 We define a value of an interval is the second largest number of it's elements, and of course a
阅读全文
摘要:Let us consider a special type of a binary search tree, called a cartesian tree. Recall that a binary search tree is a rooted ordered binary tree, suc
阅读全文
摘要:Xuanxuan has n sticks of different length. One day, she puts all her sticks in a line, represented by S1, S2, S3, ...Sn. After measuring the length of
阅读全文
摘要:For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultim
阅读全文
摘要:https://ac.nowcoder.com/acm/contest/203/E 埋坑不会做
阅读全文
摘要:一个叫做立方体大作战的游戏风靡整个Byteotia。这个游戏的规则是相当复杂的,所以我们只介绍他的简单规则:给定玩家一个有2n个元素的栈,元素一个叠一个地放置。这些元素拥有n个不同的编号,每个编号正好有两个元素。玩家每次可以交换两个相邻的元素。如果在交换之后,两个相邻的元素编号相同,则将他们都从栈中
阅读全文
摘要:For the k-th number, we all should be very familiar with it. Of course,to kiki it is also simple. Now Kiki meets a very similar problem, kiki wants to
阅读全文
摘要:Stan and Ollie play the game of Odd Brownie Points. Some brownie points are located in the plane, at integer coordinates. Stan plays first and places
阅读全文
摘要:很久很久以前,在遥远的大陆上有一个美丽的国家。统治着这个美丽国家的国王是一个园艺爱好者,在他的皇家花园里种植着各种奇花异草。有一天国王漫步在花园里,若有所思,他问一个园丁道: “最近我在思索一个问题,如果我们把花坛摆成六个六角形,那么……” “那么本质上它是一个深度优先搜索,陛下”,园丁深深地向国王
阅读全文
摘要:Description 一个N*M的方格,初始时每个格子有一个整数权值,接下来每次有2个操作: 改变一个格子的权值 求一个子矩阵中某个特定权值出现的个数 Input 每一行有两个数字N,M 接下来N行,每行M个数字。第i+1行第j个数字表示格子(i,j)的初值 接下来输入一个Q,后面Q行每行描述一个
阅读全文
摘要:萧芸斓是Z国的公主,平时的一大爱好是采花。今天天气晴朗,阳光明媚,公主清晨便去了皇宫中新建的花园采花 。花园足够大,容纳了n朵花,花有c种颜色(用整数1-c表示),且花是排成一排的,以便于公主采花。公主每次 采花后会统计采到的花的颜色数,颜色数越多她会越高兴!同时,她有一癖好,她不允许最后自己采到的
阅读全文
摘要:恢复内容开始 HH有一串由各种漂亮的贝壳组成的项链。HH相信不同的贝壳会带来好运,所以每次散步 完后,他都会随意取出一 段贝壳,思考它们所表达的含义。HH不断地收集新的贝壳,因此他的项链变得越来越长。有一天,他突然提出了一 个问题:某一段贝壳中,包含了多少种不同的贝壳?这个问题很难回答。。。因为项链
阅读全文
摘要:动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"
阅读全文
摘要:A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral n
阅读全文
摘要:Given a connected undirected graph, tell if its minimum spanning tree is unique.Definition 1 (Spanning Tree): Consider a connected, undirected graph G
阅读全文
摘要:Windy has a country, and he wants to build an army to protect his country. He has picked up N girls and M boys and wants to collect them to be his sol
阅读全文
摘要:Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs you
阅读全文
摘要:An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unex
阅读全文
摘要:There are n cities numbered from 1 to n in Berland. Some of them are connected by two-way roads. Each road has its own length — an integer number from
阅读全文
摘要:自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球。为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响。关于如何排名,这个不用说都知道是根据Rating从高到低来排,如果
阅读全文
摘要:A certain local trucking company would like to transport some goods on a cargo truck from one place to another. It is desirable to transport as much g
阅读全文
摘要:Order is an important concept in mathematics and in computer science. For example, Zorn's Lemma states: ``a partially ordered set in which every chain
阅读全文
摘要:A catenym is a pair of words separated by a period such that the last letter of the first word is the same as the last letter of the second. For examp
阅读全文

浙公网安备 33010602011771号