consecutive sum II
Time limit:3000/1000 MS (java/others) Memory limit:32768/32768 K (java/others) total submission (s): 2237 Accepted S Ubmission (s): 1093
Problem Description
Consecutive sum come again. Is it ready? Go ~ ~
1 = 0 + 1
2+3+4 = 1 + 8
5+6+7+8+9 = 8 + 27
...
You can see the consecutive sum can is representing like that. The nth line'll has 2*n+1 consecutive numbers on the left and the first number on the right equal with the second number I n last line, and the sum of the left numbers equal with the number ' s sum in the right.
Your task is this tell me the right numbers in the nth line.
Input
The first integer is T, and T lines would follow.
Each line would contain an integer n (0 <= n <= 2100000).
Output
For each case, the output of the right numbers on the Nth line.
All answer in the range of signed 64-bits Integer.
Sample Input
3
0
1
2
Sample Output
0 1
1 8
8 27
Author
Wiskey
Title: Recursive, input N, output is n*n*n (n+1) * (n+1) * (n+1)
#include <iostream>using namespace Std;int main () { __int64 A; int T; Cin >> T; while (t--) { cin >> A; cout << a*a*a << << (a+1) * (a+1) * (a+1) << Endl; } return 0;}
HDU1977 consecutive sum II "water problem"