HDU-5053 the Sum of Cube
来源:互联网 发布:淘宝宝贝描述上传图片 编辑:程序博客网 时间:2024/05/16 08:33
the Sum of Cube
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1218 Accepted Submission(s): 484
Each case of input is a pair of integer A,B(0 < A <= B <= 10000),representing the range[A,B].
21 32 5
Case #1: 36Case #2: 224
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<stdlib.h>
#include<iomanip>
#include<list>
#include<deque>
#include<map>
#include <stdio.h>
#include <queue>
#define maxn 1000010
#define ull unsigned long long
#define ll long long
#define reP(i,n) for(i=1;i<=n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define cle(a) memset(a,0,sizeof(a))
#define mod 90001
#define PI 3.141592657
#define INF 1<<30
const ull inf = 1LL << 61;
const double eps=1e-5;
using namespace std;
bool cmp(int a,int b){
return a>b;
}
ll sum;
ll n,m;////n,m也用long long
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int t;
while(~scanf("%d",&t))
{
for(int j=1;j<=t;j++)
{
scanf("%I64d%I64d",&n,&m);
sum=0;
for(ll i=n;i<=m;i++)
sum+=(ll)(i*i*i);
printf("Case #%d: %I64d\n",j,sum);
}
}
return 0;
}
- HDU-#5053 the Sum of Cube
- 【水题】HDU 5053 the Sum of Cube
- HDU - 5053 the Sum of Cube
- HDU 5053 the Sum of Cube
- HDU--5053 the Sum of Cube
- hdu 5053 the Sum of Cube 水题
- HDU-5053 the Sum of Cube
- HDU 5053 the Sum of Cube
- hdu 5053 the Sum of Cube
- 【hdu 5053】the Sum of Cube
- Hdu-5053 the Sum of Cube(水题)
- HDU-5053 the Sum of Cube 签到到到到~
- HDU——5053 the Sum of Cube
- hdu 5053 the Sum of Cube(上海网络赛)
- hdu 5053 the Sum of Cube(水)
- HDU-5053-the Sum of Cube【打表】
- the Sum of Cube
- The Sum of Cube
- HDU 1166 敌兵布阵
- HOJ 1876经理的烦恼
- HDU 2097Sky数
- HDU 2046骨牌铺方格(滚动数组)
- POJ 2352 Stars
- HDU-5053 the Sum of Cube
- HDU 2041
- LeetCode145 Binary Tree Postorder Traversal(迭代实现) Java
- POJ 1195 Mobile phones(二维树状数组)
- ZOJ1091 Knight Moves
- CF 275.5 A. SwapSort
- CF 277.5 B. BerSU Ball
- HDU 2594
- HDU1686Oulipo