2014上海网络赛 HDU 5053 the Sum of Cube
水
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
#include<iostream>
#define LL long long
using namespace std; int main()
{
int t;
int a,b;
int cas;
LL sum;
while(~scanf("%d",&t))
{
for(int i=;i<=t;i++)
{
sum=;
scanf("%d%d",&a,&b);
for(int j=a;j<=b;j++)
{
sum+=pow(j,);
}
printf("Case #%d: %lld\n",i,sum);
}
}
return ;
}
2014上海网络赛 HDU 5053 the Sum of Cube的更多相关文章
- hdu 5053 the Sum of Cube(上海网络赛)
the Sum of Cube Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- 2015上海网络赛 HDU 5478 Can you find it 数学
HDU 5478 Can you find it 题意略. 思路:先求出n = 1 时候满足条件的(a,b), 最多只有20W对,然后对每一对进行循环节判断即可 #include <iostre ...
- 2015上海网络赛 HDU 5475 An easy problem 线段树
题意就不说了 思路:线段树,维护区间乘积.2操作就将要除的点更新为1. #include<iostream> #include<cstdio> #include<cstr ...
- HDU 5053 the Sum of Cube
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5053 解题报告:用来陶冶情操的题,求a到b的三次方的和. #include<stdio.h> ...
- HDU 5053 the Sum of Cube(简单数论)
http://acm.hdu.edu.cn/showproblem.php?pid=5053 题目大意: 求出A^3+(A+1)^3+(A+2)^3+...+B^3和是多少 解题思路: 设f(n)=1 ...
- UVA LA 7146 2014上海亚洲赛(贪心)
option=com_onlinejudge&Itemid=8&page=show_problem&category=648&problem=5158&mosm ...
- ccpc 网络赛 hdu 6155
# ccpc 网络赛 hdu 6155(矩阵乘法 + 线段树) 题意: 给出 01 串,要么询问某个区间内不同的 01 子序列数量,要么把区间翻转. 叉姐的题解: 先考虑怎么算 \(s_1, s_2, ...
- 杭电 5053 the Sum of Cube(求区间内的立方和)打表法
Description A range is given, the begin and the end are both integers. You should sum the cube of al ...
- HDU 5045 5047 5050 5053(上海网络赛E,F,I,L)
HDU 5045 5047 5050 5053 太菜了,名额差点没保住.吓尿..赶紧开刷树链抛分 5045:状压DP.压缩10个人.因为两个人不能差2以上,所以能够用01表示 5047:推推公式就可以 ...
随机推荐
- Android支付接入(二):移动游戏基地
原地址:http://blog.csdn.net/simdanfeg/article/details/9011863 上篇博文跟大家一起走了一遍支付宝支付,今天我们来看看移动支付.众所周知目前付费通道 ...
- Deployment of VC2008 apps without installing anything
If you create a default CRT/MFC application with VS2008, this application will not run on other comp ...
- IOS开发之表视图(UITableView)
IOS开发之表视图(UITableView)的基本介绍(一) (一):UITableView的基本概念 1.在IOS开发中,表视图的应用十分广泛和普及.因此掌握表视图的用法显得非常重要.一般情况下对于 ...
- POJ 2318 TOYS && POJ 2398 Toy Storage(几何)
2318 TOYS 2398 Toy Storage 题意 : 给你n块板的坐标,m个玩具的具体坐标,2318中板是有序的,而2398无序需要自己排序,2318要求输出的是每个区间内的玩具数,而231 ...
- php关于private、public成员变量访问问题
如果类里面定义了__get($name)方法,则不论类的private成员还是public成员,都能够在类的外面通过类似$class->name访问到.如果是public变量,则不会自动调用ge ...
- 修改netbeans模版头部的说明
以新建一个php类文件为例: 有两个地方需要修改, 1,工具->模版->默认许可证->在编辑器中打开 2,工具->模版->选择php类->在编辑器中打开 即可进行修 ...
- lighttpd 介绍及安装
一,为什么要使用lighttpd? apache不可以吗? 在支持纯静态的对象时,比如图片,文件等 , lighttpd速度更快,更理想 (lighttp 图片处理好,nginx负载 ...
- C3p0/元数据/内省-Bean/自定义查询封装类/查询/分页
c3p0连接池(C3p0连接池,只有当用户获取连接时,才会包装Connection.) 第一步:导入c3p0 第二步:在classpath目录下,创建一个c3p0-config.xml 第三步:创建工 ...
- Lambda表达式 =>(msdn)
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- Javascript String类的属性及方法
String 类 Attribute and method anchor() 创建一个<a>标签的实例,将其name属性设置为被传递给此方法的字符串 big() ...