Kostya the Sculptor】的更多相关文章

D. Kostya the Sculptor time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a frien…
Kostya the Sculptor 这次cf打的又是心累啊,果然我太菜,真的该认真学习,不要随便的浪费时间啦 [题目链接]Kostya the Sculptor &题意: 给你n个长方体,你要使长方体的内切球有体积最大,有两种选择方案 ①只选1个长方体. ②选2个长方体,黏到一起,但这2个长方体黏的那一面必须完全相等.也就是长宽相等. &题解: 1个长方体遍历一遍取最小就好了. 2个的时候要第2短的和第3短的相等,才能合到一起,最小的有可能是2个最小的相加,或者是第2短的那个. 这题比…
D. Kostya the Sculptor time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a frien…
Kostya the Sculptor time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a friend Z…
Kostya the Sculptor 题目链接:http://codeforces.com/problemset/problem/733/D 贪心 以次小边为第一关键字,最大边为第二关键字,最小边为第三关键字排序,每次只需要找次小边和最大边均相同,最小边最大的两项即可. 因为用Python遇到很多问题,切片操作a[i:j]是左闭右开区间[i,j) 代码如下: n = int(input()) a = [] ans,u,v = 0,-1,-1 for i in range(n): t = [in…
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a friend Zahar who works at a care…
Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a friend Zahar who works at a career. Zahar knows about Kostya's idea and wants to present him a rectangular parallelepiped of marble from w…
对于n==100.1,1,2或者1,2,2大量重复的形状相同的数据,cmp函数最后一项如果表达式带等于,整个程序就会崩溃 还没有仔细分析std::sort的调用过程,所以这里不是很懂..,mark以后研究 因为题目让你挑一到两个平行六面体,然后去每个平行六面体长宽高的最小值,然后去求最小值中的最大值 我们很容易想到暴力的做法,如果两个平行六面体能够合并的话,那我们直接计算合并之后的最小值,因为我们知道此时 合并之后再求最小值,它是只增不减的 那么我们就要找到能合并某一个面的所有平行六面体的集合,…
题目链接:http://codeforces.com/contest/733/problem/D 题意:给n个长方体,允许最多两个拼在一起,拼接的面必须长宽相等.问想获得最大的内切圆的长方体序号是多少.最多拼2个,可以不拼. 最大内切圆与最短的边有关系,在读入的时候做只取一个的情况,接下来按照边长从大到小排序,之后按照最大边依次排序,取相邻的两个拼接在一起看看是否更大. #include <bits/stdc++.h> using namespace std; typedef struct S…
排序.把每一个长方体拆成$6$个做,然后排序做即可. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<map> #include<set> #inc…