标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 5598 Accepted Submission(s): 3816
#include<stdio.h> #define LL __int64 LL ans[10005]; void init() { ans[0]=1; ans[1]=2; ans[2]=8; for(int i=3;i<=10000;i++) { //(2*(n-1)-1)*3+3=6*(n-1) ans[i]=ans[i-1]+6*(i-1); } } int main() { int n,T; init(); scanf("%d",&T); while(T--) { scanf("%d",&n); printf("%I64d\n",ans[n]); } return 0; }
标签:
原文地址:http://www.cnblogs.com/yuyixingkong/p/4649662.html