Cube(规律)
Cube
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 1722 Accepted Submission(s): 1367
Process to the end of file.
2
3
16
297
Hint
The results will not exceed int type.
题解:好菜,自己竟然没推出来。。。
总对数n^3*(n^3-1)/2;
点数为4的对数:一行有n-1对,一个面有总共n*n行,三个面面要乘以3;
总的减去4的就是<=2的了;
代码:
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
#define mem(x,y) memset(x,y,sizeof(x))
#define SI(x) scanf("%d",&x)
#define PI(x) printf("%d",x)
#define P_ printf(" ")
const int INF=0x3f3f3f3f;
int main(){
int n;
while(~scanf("%d",&n)){
printf("%d\n",n*n*n*(n*n*n-)/-n*n*(n-)*);
}
return ;
}
Cube(规律)的更多相关文章
- HDU 1220 Cube(数学,找规律)
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1220 Cube Time Limit: 2000/1000 MS (Java/Others) M ...
- Cube 找规律
这道题我们经过简单的推测便可得知3个之前特判,四个之后就成为了一般状况,就是我们每侧都是走整个整个的|_|之后零的走|||. 考试的时候包括平时做题,许多正确的感性比理性证明要强得多. #includ ...
- UVA 253 Cube painting(暴力打表)
Cube painting Problem Description: We have a machine for painting cubes. It is supplied with three d ...
- Break the Chocolate(规律)
Break the Chocolate Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Othe ...
- [补档]Cube
Cube 题目 给你一个n×m的棋盘,有一个1×1×2的长方体竖直放在(1,1)上,你可以将其在棋盘上滚动,你的目标是让其竖直放在(n,m)上,问至少需要多少次操作.(放倒.竖直.翻滚) INPUT ...
- HDU 多校对抗第三场 L Visual Cube
Problem L. Visual Cube Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java ...
- SQL SEVER (ROLLUP与CUBE,ROW_NUMBER())使用方法
1.建立测试专用数据: if object_id('TESTDB') is not null drop table TESTDB ), B INT) insert into TESTDB union ...
- hdu1452 Happy 2004(规律+因子和+积性函数)
Happy 2004 题意:s为2004^x的因子和,求s%29. (题于文末) 知识点: 素因子分解:n = p1 ^ e1 * p2 ^ e2 *..........*pn ^ en 因子 ...
- Codeforces Round #384 (Div. 2) B. Chloe and the sequence(规律题)
传送门 Description Chloe, the same as Vladik, is a competitive programmer. She didn't have any problems ...
随机推荐
- stream~filestream
http://blog.csdn.net/feliciafay/article/details/6157356 http://blog.csdn.net/feliciafay/article/deta ...
- HTML 5 <details> 标签
<details> 标签用于描述文档或文档某个部分的细节. <details> <summary>Copyright 2011.</summary> & ...
- codility上的练习(3)
今天发现又出了lesson 3... 不过题目都很简单…… (1) Min-avg-slice 给定一个长度为n的整数数组,找到一个连续的子数组,数组元素的平均值最小. 数据范围N [1..10^5] ...
- hdu 4775 Infinite Go(暴力)
pid=4775" target="_blank" style="">题目链接:hdu 4775 Infinite Go 题目大意:两个人下围棋 ...
- Applet 数字签名技术全然攻略
在这里先对大家说声对不起,毕竟2年前就想写这篇文章,但由于自己太懒惰一直没有写,也是为了给自己留点东西好了,前些日子我老大让我又搞这个东西发现我曾经的资料没留,又凭着自己印象从新来过,但发现网上写 ...
- 水平居中的两种方法margin text-align
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- C++ typedef与const
1.typedef 在C/C++语言中,typedef常用来定义一个标识符及关键字的别名,它是语言编译过程的一部分,但它并不实际分配内存空间: typedef int INT; ...
- 【转载】Java线程面试题 Top 50
Java线程面试题 Top 50 2014/08/21 | 分类: 基础技术 | 4 条评论 | 标签: 多线程, 面试题 分享到:140 本文由 ImportNew - 李 广 翻译自 javare ...
- MYSQL设置字段数据过长自动截断
自动截断如下设置: windows: 修改my.ini: [mysqld] sql-mode="STRICT_TRANS_TABLES" linux: 修改/ect/mysql/m ...
- PHP常用类型判断函数总结
1.gettype():获取变量类型 2.is_array():判断变量类型是否为数组类型 3.is_double():判断变量类型是否为倍浮点类型 4.is_float():判断变量类型是否为浮点类 ...