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\n",ans);
16 }
17 return 0;
18 }
乱推无敌,推完脑子就乱了。。。
溜了。
Codeforces 716C. Plus and Square Root-推公式的数学题的更多相关文章
- Codeforces 715A & 716C Plus and Square Root【数学规律】 (Codeforces Round #372 (Div. 2))
C. Plus and Square Root time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- Codeforces 715A. Plus and Square Root[数学构造]
A. Plus and Square Root time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- Codeforces Round #546 (Div. 2) E 推公式 + 线段树
https://codeforces.com/contest/1136/problem/E 题意 给你一个有n个数字的a数组,一个有n-1个数字的k数组,两种操作: 1.将a[i]+x,假如a[i]+ ...
- Codeforces Round #545 (Div. 2) 交互 + 推公式
https://codeforces.com/contest/1138/problem/F 题意 有一条长为t的链,一个长为c的环,定义终点为链和环相连环上的第一个点,现在有10个人在起点,你每次可以 ...
- Codeforces 785D Anton and School - 2(推公式+乘法原理+组合数学)
题目链接 Anton and School - 2 对于序列中的任意一个单括号对(), 左括号左边(不含本身)有a个左括号,右括号右边(不含本身有)b个右括号. 那么答案就为 但是这样枚举左右的()的 ...
- Codeforces 612E - Square Root of Permutation
E. Square Root of Permutation A permutation of length n is an array containing each integer from 1 t ...
- Codeforces Round #372 (Div. 1) A. Plus and Square Root 数学题
A. Plus and Square Root 题目连接: http://codeforces.com/contest/715/problem/A Description ZS the Coder i ...
- codeforces 185A Plant(推公式)
Plant [题目链接]Plant [题目类型]推公式 &题解: 这个是可以推公式的: 每年的总个数是4^n个,设n年时向上的个数是x个,向下的个数是y个,那么n+1年时,向上的个数是3* x ...
- Project Euler 57: Square root convergents
五十七.平方根收敛(Square root convergents) 二的平方根可以表示为以下这个无穷连分数: \[ \sqrt 2 =1+ \frac 1 {2+ \frac 1 {2 +\frac ...
随机推荐
- D3DXCreateTextureFromFile
HRESULT D3DXCreateTextureFromFile( __in LPDIRECT3DDEVICE9 pDevice, __in LPCTSTR pSrcFile, __out LPDI ...
- json对象数据列数
// var len = data.length(); // alert(data.Rows.length); var colCount = (function count(){//一条记录中有几个键 ...
- Android 使用剪贴板传递简单数据及复杂数据的方法
传递数据的场景在于不同页面之间跳转,需要携带数据:简单数据值指的是String, int等数据, 复杂数据指的是类 1. 使用剪贴板传递简单数据方法: 第一个页面里面放数据操作如下: Clipbo ...
- Python基础-week01 Python安装/变量/输入/及循环语句使用
一.Python介绍 (1).目前Python主要应用领域: 云计算: 云计算最火的语言, 典型应用OpenStack WEB开发: 众多优秀的WEB框架,众多大型网站均为Python开发,You ...
- HTML textarea 无法修改 value 的问题
当设置了 textarea 的 value 后,发现页面的输入框无法输入值, <textarea id="></textarea> 解决方法: 只需将值设置在 ...
- 04 JVM是如何执行方法调用的(上)
重载和重写 重载:同一个类中定义名字相同的方法,但是参数类型或者参数个数必须不同. 重载的方法在编译过程中就可完成识别.具体到每一个方法的调用,Java 编译器会根据所传入参数的生命类型来选取重载方法 ...
- [报错处理]Could not find a version that satisfies the requirement xml (from versions)
安装xml库发生报错 pip3 install xml Collecting xml Could not find a version that satisfies the requirement x ...
- Eclipse 4.6(最新版本) js文件不能F3
解决办法........我是没找到解决4.6版本的办法!不过可以换一个版本!猜想是因为 最新版本强制要求使用jdk1.8所导致的~! 换了一个4.5版本就一切Ok 换上主题一样漂亮护眼
- 【Luogu】P3750分手是祝愿(期望DP)
题目链接 这题好喵啊…… 设f[i]是最少用i次才能全关上转移到最少用i-1次才能全关上灯的期望值,那么n个灯里有i个是正确的,剩下的都是不正确的 因此期望是$f[i]=frac{n}{i}+frac ...
- php中的对象赋值
如果现在问你一个问题: <?php class A{ public $a = 1; } $a = new A(); $b = $a; $b->a = 3; print_r($a->a ...