hdu 5053(2014上海网赛1012) the Sum of Cube
来源:互联网 发布:may it be 编辑:程序博客网 时间:2024/05/20 19:32
题意:给一个区间,求区间内所有数的立方的和。
思路:打表,暴力相加。
#include <iostream> #include <stdio.h> #include <cmath> #include <algorithm> #include <iomanip> #include <cstdlib> #include <string> #include <vector> #include <queue> #include <stack> #include <map> #include <set> #include <string.h>#include <ctype.h> using namespace std; #define ll long longll tab[10010];int main(){ for(ll i=0;i<=10000;i++){ tab[i]=i*i*i; } int t; cin>>t; int cas=0; while(t--){ cas++; int a,b; cin>>a>>b; ll ans=0; for(int i=a;i<=b;i++){ ans+=tab[i]; } printf("Case #%d: %I64d\n",cas,ans); } return 0;}
0 0
- hdu 5053(2014上海网赛1012) the Sum of Cube
- hdu 5053 the Sum of Cube(上海网络赛)
- hdu 5053 the Sum of Cube---2014acm上海赛区网络赛
- 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【打表】
- 数据结构——栈之顺序栈
- 程序猿的生活
- CentOS-6.4-minimal版中通过JK-1.2.40整合Apache-2.2.29与Tomcat-6.0.41
- 不同包的调用
- Javascript中的Bind,Call和Apply
- hdu 5053(2014上海网赛1012) the Sum of Cube
- C++晋升之多线程二(多线程的一些特点)
- Handler: Activity 之间通过 Handler 通信
- PRML 阅读笔记(一)<1.1--1.2>
- 通过jkstatus监控JK-1.2.40连接状态
- HDU 5047 Sawtooth 规律+ C++大数模拟 2014 ACM/ICPC Asia Regional Shanghai Online
- 《effective C++》条款5
- PB多线程的缺陷与实现机制浅析
- HDU Tree LCA 2014 ACM/ICPC Asia Regional Shanghai Online