点击打开链接
找规律,不能直接算,否则超时
n=(n+2)*(n+1)*n/6;
#include<stdio.h> int main() { __int64 n; while(scanf("%I64d",&n)!=EOF) { n=(n+2)*(n+1)*n/6; printf("%I64d\n",n); } return 0; }