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 ...
随机推荐
- CSS浏览器兼容问题集-第一部分
CSS对浏览器的兼 容性有时让人很头疼,或许当你了解当中的技巧跟原理,就会觉得也不是难事,从网上收集了IE7,6与Fireofx的兼容性处理方法并整理了一下.对于 web2.0的过度,请尽量用xhtm ...
- MongoDB监控一 mongostat
mongostat命令 mongostat可以提供mongod和mongos ...
- ZendFramework 环境部署
查看源码 int_autoloader.php 文件中,发现应用了一个 AutoloaderFactory 的命名空间,路径写得是相对路径,所以需要在 php.ini 中定义一个 inclde_pat ...
- HTML+CSS学习
1.彻底弄懂CSS盒子模式(DIV布局快速入门) 2.在CSS中,BOX的Padding属性的数值赋予顺序为padding:10px; 四个内边距都是10px padding:5px 10px; 上下 ...
- POJ 2488 A Knight's Journey(DFS)
A Knight's Journey Time Limit: 1000MSMemory Limit: 65536K Total Submissions: 34633Accepted: 11815 De ...
- ES6新特性-------数组、Math和扩展操作符(续)
三.Array Array对象增加了一些新的静态方法,Array原型上也增加了一些新方法. 1.Array.from 从类数组和可遍历对象中创建Array的实例 类数组对象包括:函数中的argumen ...
- BZOJ 1084 最大子矩阵
http://www.lydsy.com/JudgeOnline/problem.php?id=1084 思路:分m=1和m=2操作 #include<algorithm> #includ ...
- Amazon Redshift and Massively Parellel Processing
Today, Yelp held a tech talk in Columbia University about the data warehouse adopted by Yelp. Yelp u ...
- 2.x ESL第二章习题 2.8
题目 代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3 ...
- ZOJ 2048(Prim 或者 Kruskal)
Highways Time Limit: 5 Seconds Memory Limit: 32768 KB Special Judge The island nation of F ...