Codeforces 716C. Plus and Square Root-推公式的数学题

http://codeforces.com/problemset/problem/716/C

codeforces716C. Plus and Square Root

这个题就是推,会推出来规律,发现和等级有关系,等级的平方然后减去数字啥的,忘记了,推的草稿纸找不到了。。。

推出来就是类似a+b的题目。

代码:

 1 #include<iostream>
 2 #include<cstring>
 3 #include<cstdio>
 4 #include<cmath>
 5 #include<algorithm>
 6 #include<queue>
 7 using namespace std;
 8 typedef long long ll;
 9 int main(){
10     int n;
11     scanf("%d",&n);
12     for(ll i=1;i<=n;i++){
13         ll ans=i*i*i+2*i*i+1;
14         if(i==1)ans=2;
15         printf("%lld
",ans);
16     }
17     return 0;
18 }

乱推无敌,推完脑子就乱了。。。

溜了。

原文地址:https://www.cnblogs.com/ZERO-/p/9729020.html