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 ...
随机推荐
- Java基础知识:Collection接口
*本文是最近学习到的知识的记录以及分享,算不上原创. *参考文献见文末. 这篇文章主要讲的是java的Collection接口派生的两个子接口List和Set. 目录 Collection框架 Lis ...
- HDU 5739 Fantasia 双连通分量 树形DP
题意: 给出一个无向图,每个顶点有一个权值\(w\),一个连通分量的权值为各个顶点的权值的乘积,一个图的权值为所有连通分量权值之和. 设删除顶点\(i\)后的图\(G_i\)的权值为\(z_i\),求 ...
- Redis实现之对象(一)
对象 前面我们介绍了Redis的主要数据结构,如:简单动态字符串SDS.双端链表.字典.压缩列表.整数集合等.Redis并没有直接使用这些数据结构来实现键值对数据库,而是基于这些数据结构创建了一个对象 ...
- cf982d Shark
ref #include <algorithm> #include <iostream> #include <cstdio> #include <map> ...
- [网站公告]又拍云API故障造成图片无法上传(已恢复)
大家好,18:00左右开始,又拍云API出现故障,调用图片上传API时出现错误:“The remote server returned an error: (403) Forbidden.”,造成图片 ...
- 申请社交平台appkey详细教程
申请社交平台appkey详细教程 大部分app都需要实现分享到微信.微博等社交平台的功能,但是在各个平台上申请appkey是一件很繁琐的事情.现在来分享一个申请社交平台appkey详细教程,在开发过程 ...
- Windows网络编程笔记4 -- Winsock 协议相关知识
Win32平台上的Winsock编程,Winsock是一个与协议无关的接口.以下协议是我们需要了解的: 网络协议的特征包括: 1. 面向消息 2. 面向连接和无线接 3. 可靠性和次序性 4. ...
- 【Python】locust框架接口性能测试(一)
本人工作中主要对接口与web进行性能测试,而接口测试主要为http协议接口和webservice接口,本文主要对locust框架http接口测试先进行简单介绍. 1.测试需求 对某系统登录接口进行测试 ...
- [oldboy-django][2深入django]cookies + session
1.1 cookies - 初识cookie a.cookie是保留在浏览器端的键值对 b.服务端可以向客户端写cookie c.客户端每次发送请求,会携带cookie一起发送过去,而且cookie是 ...
- [oldboy-django][1初始django]模态对话框 + 动态加载gif (多对多数据库表)
ajax+对话框(多对多) - 遮罩层,动态加载gif层,对话框层, a.一点击添加,绑定事件: - 出现遮罩层和动态gif层 - ajax向后台发送请求获取所有班级数据 - success,隐藏动态 ...