Cube(hd1220)
Cube
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 common points or two common points or four
common points. Your job is to calculate how many pairs of unit cubes that have
no more than two common points.
Process to the end of file.
give the edge length N of a cube in one line. N is a positive
integer(1<=N<=30).
pairs that was described above in one line.
所以结果为:n^3 * (n^3-1) - 3*n^2(n-1)

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int main()
{
int num;
while(cin>>num)
{
int sum=(pow(num,)*(pow(num,)-)/)-pow(num,)**(num-);
cout<<sum<<endl;
}
}
Cube(hd1220)的更多相关文章
- ZOJ 2477 Magic Cube(魔方)
ZOJ 2477 Magic Cube(魔方) Time Limit: 2 Seconds Memory Limit: 65536 KB This is a very popular gam ...
- PLSQL_基础系列02_分组函数GROUP BY / ROLLUP / CUBE(案例)
2014-11-30 Created By BaoXinjian
- stm32.cube(一)——系统架构及目录结构
一.前言 Arm的应用场景往往比51单片机复杂得多,如果一个高级应用的开发需要连底层的结构性代码都要重构,那么在成本和研发周期上就会面临巨大的风险.为了简化编码过程,芯片厂商经常会提供一些板卡级支持的 ...
- 《BI项目笔记》创建多维数据集Cube(1)
有两个事实表,因此就有两个度量值组,并且向导将为非维度键的事实表中的每一个数值列创建一个度量值.由于我们这里不需要那么多,所以只选择部分度量值.另外要注意,度量值的名称源于事实表中的列,所有名称由可能 ...
- 《BI项目笔记》创建多维数据集Cube(2)
本节建立: 历年的初烟水分均值变化分析Cube:区域维度:地州,专县时间维度:年等级维度:大等级,小等级指标:水分均值 数据源视图: 数据处理: ) ) DELETE FROM T_QualMoist ...
- Cube(规律)
Cube Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submi ...
- hdoj--5053--the Sum of Cube(水)
the Sum of Cube Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Tot ...
- 【HDOJ6330】Visual Cube(模拟)
题意: 思路: import java.util.Scanner; public class Main { public static void main(String args[]) { Scann ...
- HDU 3584 Cube(三位树状数组)
Cube Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submi ...
随机推荐
- javascript 实现禁止右键,复制,选取文本 (兼容firefox,IE,chrome等主流浏览器)
1. JS 禁止右键 <script type="text/javascript">document.oncontextmenu=function(e){return ...
- 蘑菇街2015校招技术类笔试题A卷,回忆版(杭州站)
笔试时间:10月9号 下午 1.一串数据的最大递增序列,输出个数 例如 4,2, 6,3, 1,5, 最大递增序列为, 2,3, 5,输出3, 2.求两个整型数据集合的交集,尽可能少用时间. 假设两个 ...
- Radar Installation(POJ 1328 区间贪心)
Radar Installation Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 68578 Accepted: 15 ...
- HDU 4939 Stupid Tower Defense
dp:枚举red,dp前i 个塔中有j 个蓝塔的最大伤害. 机智的地方:dp前i 个塔的时候可以同时处理n-i 个红塔,这样就少了个循环...(枚举红塔的循环) #include <iostre ...
- eclipse 使用mvn模块化开发
1.创建maven父工程步骤:new-->other-->选择maven project-->next-->勾选create a simple project-->nex ...
- C 宏定义
C/C++中宏使用总结 .C/C++中宏总结C程序的源代码中可包括各种编译指令,这些指令称为预处理命令.虽然它们实际上不是C语言的一部分,但却扩展了C程序设计的环境.本节将介绍如何应用预处理程序和注释 ...
- javascript之全局函数
一.eval() //执行一段字符串中的javascript代码. 语法:eval(code); //可以将javascript写在字符串里面执行. var str = "document. ...
- Course Schedule II 解答
Question There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may ...
- HDU1754(线段树)
I Hate It Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
- 在Linux下如何创建LVM及LVM创建过程
Linux LVM创建过程:(我用的是Centos6.8) 一.准备工作: LVM可以的创建可以在系统安装的过程中创建,也可以在安装完系统之后再创建建,都是可以的,我的是在系统安装完之后创建的,具体的 ...