hdoj--1220--Cube(数学推导)
来源:互联网 发布:淘宝客qq群介绍 编辑:程序博客网 时间:2024/05/29 19:55
Cube
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 1723 Accepted Submission(s): 1368
Problem Description
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 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.
Process to the end of file.
Input
There will be many test cases. Each test case will only give the edge length N of a cube in one line. N is a positive integer(1<=N<=30).
Output
For each test case, you should output the number of pairs that was described above in one line.
Sample Input
123
Sample Output
016297The results will not exceed int type.HintHint
Author
Gao Bo
#include<cstdio>#include<cstring>int main(){int n;while(scanf("%d",&n)!=EOF){printf("%d\n",n*n*n*(n*n*n-1)/2-3*n*n*(n-1));}return 0;}
0 0
- hdoj--1220--Cube(数学推导)
- HDOJ 1220 Cube (数学)
- HDOJ题目1220 Cube(组合数学)
- HDOJ 1220-Cube【数学推理】
- HDOJ 1220 Cube【数学推理】
- hdoj Cube 1220 (数学规律&排列组合)找正方体
- hdoj 3980 Paint Chain(数学推导)
- HDOJ 5826 physics(数学推导)
- hdoj 1220 Cube(数学题)
- HDU:1220 Cube(数学)
- hdoj the Sum of Cube 5053 (简单数学)
- HDOJ 5734 Acperience (数学推导)
- hdoj 1220 Cube
- HDOJ--1220--Cube
- hdoj 1220Cube
- hdoj 1220 Cube
- 杭电 1220 Cube(纯数学)
- ACM--公式--HDOJ 1220--Cube
- hdu 1232 畅通工程(基础模板)
- handler机制详解
- Android中的HandlerThread和IntentService
- 获取COM串口数量-VC编程
- launcher/notification icon的尺寸标准
- hdoj--1220--Cube(数学推导)
- ubuntu的关机重启和注销命令
- js、 数组
- uva11008
- 创建二叉排序树,二叉树的六种遍历
- AFNetworking使用
- 剑指offer --- 二叉树中和为某一数的路径
- 如何更好使用wampum
- (有码)NSOperation