HDOJ 1220 Cube】的更多相关文章

CubeTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 972    Accepted Submission(s): 775 Problem Description Cowl is good at solving math problems. One day a friend asked him such a question: You…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1220 Cube Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2627    Accepted Submission(s): 2064 Problem Description Cowl is good at solving math pro…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1220 问题描述 Cowl擅长解决数学问题. 有一天,一位朋友问他这样一个问题:给你一个边长为N的立方体,它被与其侧面平行的平面切割成N * N * N个单位立方体. 两个单位立方体可能没有共同点或两个共同点或四个共同点. 你的工作是计算有多少对不超过两个公共点的单位立方体.处理到文件的结尾. 输入 会有很多测试用例. 每个测试用例只会在一行中给出一个立方体的边长N. N是正整数(1 <= N <=…
http://acm.hdu.edu.cn/showproblem.php?pid=1220 Cube Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2260    Accepted Submission(s): 1819 Problem Description Cowl is good at solving math problems…
A:HDU 1060 Leftmost Digit(求N^N的第一位数字 log10的巧妙使用) B:(还需要研究一下.....) C:HDU 1071 The area(求三个点确定的抛物线的面积,其中一个点是顶点) D:HDU 1077 Catching Fish(用单位圆尽可能围住多的点) E:HDU 1099 Lottery (求数学期望) F:HDU 1110 Equipment Box (判断一个大矩形里面能不能放小矩形) G:HDU 1155 Bungee Jumping(物理题,…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3547 题目大意:求用$C$种颜色给立方体的8个顶点染色的本质不同的方法.两种方法本质不同即不能通过旋转立方体使得两个立方体的染色情况一致. 简要题解:首先可以得到有24种组合旋转方式.根据Polya定理以及群论中的拉格朗日定理,然后再自己多想一想,就可以得到:$Ans=\frac{x^8+Ax^4+Bx^2+Cx}{24}$,可知有3个未知数,然后样例正好有3组数据,所以可以解方程解得$A=17,B…
1. 题目描述给定一个$2 \times 2 \times 2$的魔方,当某个面上的4个小块颜色均相同时,称这个面为complete.求对这个魔方进行$n \in [1,7]$次旋转(沿某个面顺时针或者逆时针)的过程中,求complete的面总和的最大值.魔方及索引如下图所示: 2. 基本思路及代码解法一(MLE):刚读过题,觉得挺简单的,时限10000ms还挺长的.需要搞清楚沿着某个面旋转后矩阵的元素是如何变化的.就想到可以进行状态压缩$6^24 < 2^63$,因此将cube表示的矩阵可以使…
Cowl is good at solving math problems. One day a friend asked him such a question: You are given a cube whose edge length is N, it is cut by the planes that was paralleled to its side planes into N * N * N unit cubes. Two unit cubes may have no commo…
http://acm.hdu.edu.cn/showproblem.php?pid=1220 一开始的做法是,先暴力算出一个面,就是n * n的面,能有多少对.记作face 然后从上开始算下来,最上一层,face个,然后第二层,有n * n * (up - 1)个. 递推下去,up是在第i层上面有多少个. #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #inc…
三位树状数组. /* 3584 */ #include <iostream> #include <string> #include <map> #include <queue> #include <vector> #include <algorithm> #include <cstdio> #include <cmath> #include <cstring> #include <climit…