Problem Description Keke is currently studying engineering drawing courses, and the teacher has taught her how to find its volume through the three views of the part. But her brain doesn't work well that she can't find the volume of complex parts. So…
今天水了一发hdu上的中山校赛 这个题交了将近十遍才过...... 就是说给 n 个木棍,如果能找出3个能组成三角形的木棍就输出yes 反之输出no 乍一看很简单 一个排序遍历一遍就好了 但是n值太大了,我试了一下,就算不加sort都会TLE...... 问了一下大神才想出这个关键的条件: 假设 a1=1,a2=2,a3=3 那么这是最小的三个不能组成三角形的木棍, 所以如果n=4,那么a4最小是a2+a3=5 n=5,a5最小是8 ................ 当n=47时,a47=480…
题目地址 题目大意:给你一个n*m的矩形,在这个矩形内告诉你p个矩形(左下角和右上角坐标),问你q个问题,每次也是给你一个矩形(左下角和右上角坐标),问你每个矩形是否可以被开始给的p个矩形完全覆盖. 思路:n*m范围是1e7,无法开二维数组,二维坐标可以转化为(n-1)*m+m,用一维数组来记录每个坐标的前缀和(即为这个点与0,0点组成矩形的面积),先通过二维差分,将前缀和记录一边.因为有覆盖的情况,所以将前缀和大于0的初始化为1,在来一遍前缀和,处理好之后就可以O(1)的时间算出每个矩形是否可…
题目描述 俄罗斯套娃是俄罗斯特产的木制玩具,一般由多个一样图案的空心木娃娃一个套一个组成,最多可达十多个,通常为圆柱形,底部平坦可以直立.颜色有红色,蓝色,绿色,紫色等.最普通的图案是一个穿着俄罗斯民族服装的姑娘,叫做“玛特罗什卡”,这也成为这种娃娃的通称. 彩虹岛也有自己的套娃,不过与俄罗斯套娃有所不同,其组成规则如下:1. 空心木娃娃只有正方体与球两种形状.2. 正方体娃娃与球体娃娃可以相互套,也可以相同形状之间套.3. 当两形状相切的时候使能够互相嵌套的,比如半径为2的球体能套在边长为4的…
链接:https://www.nowcoder.com/acm/contest/89/A 来源:牛客网 1.题目描述 The Great Wall story of Meng Jiangnv’s Bitter Weeping happened during the Qin Dynasty (221BC- 206BC). Meng jiangnv was a beauty in the Qin Dynasty, and she lived happily with her husband. At…
题目描述:There are n cities in Byteland, and the ith city has a value ai. The cost of building a bidirectional road between two cities is the sum of their values. Please  calculate the minimum cost of connecting these cities, which means any two cities c…
链接:https://www.nowcoder.com/acm/contest/125/A来源:牛客网 Tony and Macle are good friends. One day they joined a birthday party together. Fortunately, they got the opportunity to have dinner with the princess, but only one person had the chance. So they de…