hdoj--5053--the Sum of Cube(水)】的更多相关文章

HDU5053the Sum of Cube(水题) 题目链接 题目大意:给你L到N的范围,要求你求这个范围内的全部整数的立方和. 解题思路:注意不要用int的数相乘赋值给longlong的数,会溢出. 代码: #include <cstdio> #include <cstring> const int N = 10005; typedef long long ll; ll t[N]; void init () { for (ll i = 1; i <= N - 5; i++…
the Sum of Cube Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 405    Accepted Submission(s): 224 Problem Description A range is given, the begin and the end are both integers. You should sum…
Description A range is given, the begin and the end are both integers. You should sum the cube of all the integers in the range.   Input The first line of the input is T(1 <= T <= 1000), which stands for the number of test cases you need to solve. E…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5053 解题报告:用来陶冶情操的题,求a到b的三次方的和. #include<stdio.h> #include<string.h> #define INT __int64 int main() { ; scanf("%d",&T); INT a,b; while(T--) { scanf("%I64d%I64d",&a,&…
水 #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)) { ;i<=t;i++) { sum=; scanf…
http://acm.hdu.edu.cn/showproblem.php?pid=5053 题目大意: 求出A^3+(A+1)^3+(A+2)^3+...+B^3和是多少 解题思路: 设f(n)=1~n的立方和,则A^3+(A+1)^3+(A+2)^3+...+B^3=f(B) - f(A - 1) 题目给的数的范围是1~10000,1~10000立方和不会超过__int64(long long)的范围.由于是10000个数立方和. 所以可以选择打表(不知道立方和的公式,可以选择打表). 立方…
A range is given, the begin and the end are both integers. You should sum the cube of all the integers in the range. InputThe first line of the input is T(1 <= T <= 1000), which stands for the number of test cases you need to solve. Each case of inp…
the Sum of Cube Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 1   Accepted Submission(s) : 1 Problem Description A range is given, the begin and the end are both integers. You should sum the cu…
the Sum of Cube Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 162    Accepted Submission(s): 101 Problem Description A range is given, the begin and the end are both integers. You should sum t…
本文通过例子展示sum, rollup, cube, grouping的用法. //首先建score表 create table score( class  nvarchar2(20), course   nvarchar2(20), stu_no  number(5), stu_name nvarchar2(20), score   number(2)); //插入数据 insert into score values ('Class_A','Math',10001,'Tough1',95);…