水 #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…
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…
HDU 5478 Can you find it 题意略. 思路:先求出n = 1 时候满足条件的(a,b), 最多只有20W对,然后对每一对进行循环节判断即可 #include <iostream> #include <cstdio> #include <fstream> #include <algorithm> #include <cmath> #include <deque> #include <vector> #i…
题意就不说了 思路:线段树,维护区间乘积.2操作就将要除的点更新为1. #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<queue> #include<vector> #include<set> #include<string> #define inf…
题目链接: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,&…
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个数立方和. 所以可以选择打表(不知道立方和的公式,可以选择打表). 立方…
option=com_onlinejudge&Itemid=8&page=show_problem&category=648&problem=5158&mosmsg=Submission+received+with+ID+1708713">https://icpcarchive.ecs.baylor.edu/index.php? option=com_onlinejudge&Itemid=8&page=show_problem&…
# ccpc 网络赛 hdu 6155(矩阵乘法 + 线段树) 题意: 给出 01 串,要么询问某个区间内不同的 01 子序列数量,要么把区间翻转. 叉姐的题解: 先考虑怎么算 \(s_1, s_2, \ldots, s_n\)的答案. 设 \(dp(i, 0/1)\) 表示考虑到 \(s_i\) ,以 \(0/1\) 结尾的串的数量. 那么 \(dp(i, 0) =dp(i - 1, 0) + dp(i - 1, 1) + 1\),\(1\)也同理. 那么假设在某个区间之前,\(dp(i, 0…
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…
HDU 5045 5047 5050 5053 太菜了,名额差点没保住.吓尿..赶紧开刷树链抛分 5045:状压DP.压缩10个人.因为两个人不能差2以上,所以能够用01表示 5047:推推公式就可以,每次交线多4条 5050:求GCD.用java大叔就可以 5053:签到题 代码: 5045: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int…