codeforces 712 Memory and De-Evolution
2019-05-19
13:25:37
加油,加油,坚持,坚持!!!
一定要逆推,才可以是最少的次数
更好的方法:
https://www.cnblogs.com/ECJTUACM-873284962/p/6379014.html
#include <bits/stdc++.h>
using namespace std;
typedef long long ll; int main()
{
ll x, y; scanf("%lld %lld", &x, &y);
ll maxx = y;
ll midd = y;
ll minn = y;
ll p = ;
ll q = ;
ll count = ;
while()
{
p = maxx;
q = midd;
maxx = midd + maxx - ;
midd = p;
minn = q;
count++;
if (maxx >= x)
{
cout << count + << endl;
return ;
}
}
return ;
}
codeforces 712 Memory and De-Evolution的更多相关文章
- Codeforces 712 D. Memory and Scores (DP+滚动数组+前缀和优化)
题目链接:http://codeforces.com/contest/712/problem/D A初始有一个分数a,B初始有一个分数b,有t轮比赛,每次比赛都可以取[-k, k]之间的数,问你最后A ...
- codeforces 712B. Memory and Trident
题目链接:http://codeforces.com/problemset/problem/712/B 题目大意: 给出一个字符串(由'U''D''L''R'),分别是向上.向下.向左.向右一个单位, ...
- codeforces 712A. Memory and Crow
题目链接:http://codeforces.com/problemset/problem/712/A 题目大意: 给你一个数字系列,求其满足条件的一个序列. 条件为: ai = bi - bi + ...
- Codeforces 712E Memory and Casinos
Description There are n casinos lined in a row. If Memory plays at casino \(i\), he has probability ...
- Codeforces 712C Memory and De-Evolution
Description Memory is now interested in the de-evolution of objects, specifically triangles. He star ...
- CodeForces 712C Memory and De-Evolution (贪心+暴力)
题意:现在有一个长度为 x 的正三角形,每次可以把一条边减小,然后用最少的时间变成长度为 y 的正三角形. 析:一开始,正着想,然后有一个问题,就是第一次减小多少才能最快呢?这个好像并不好确定,然后我 ...
- CodeForces 712B Memory and Trident (水题,暴力)
题意:给定一个序列表示飞机要向哪个方向飞一个单位,让你改最少的方向,使得回到原点. 析:一个很简单的题,把最后的位置记录一下,然后要改的就是横坐标和纵坐标绝对值之和的一半. 代码如下: #pragma ...
- CodeForces 712A Memory and Crow (水题)
题意:有一个序列,然后对每一个进行ai = bi - bi + 1 + bi + 2 - bi + 3.... 的操作,最后得到了a 序列,给定 a 序列,求原序列. 析:很容易看出来,bi = ai ...
- [CodeForces - 712D]Memory and Scores (DP 或者 生成函数)
题目大意: 两个人玩取数游戏,第一个人分数一开始是a,第二个分数一开始是b,接下来t轮,每轮两人都选择一个[-k,k]范围内的整数,加到自己的分数里,求有多少种情况使得t轮结束后a的分数比b高. ( ...
随机推荐
- 图方法:寻找无向图联通子集的JAVA版本
图像处理中一般使用稠密方法,即对图像进行像素集合进行处理.在图像拓扑方面,更多地应用图计算方法. 寻找无向图联通子集的JAVA版本,代码: //查找无向图的所有连通子集//wishchin!!! pu ...
- 【sqli-labs】 less27 GET- Error based -All you Union&Select Belong to us -String -Single quote(GET型基于错误的去除了Union和Select的单引号字符型注入)
看一下过滤函数 看一下/s是什么东西 那直接通过大小写就可以绕过了 http://192.168.136.128/sqli-labs-master/Less-27/?id=0'%a0uNion%a0s ...
- 【sqli-labs】 less25a GET- Blind based -All you OR&AND belong to us -Intiger based(GET型基于盲注的去除了or和and的整型注入)
因为过滤是针对输入的字符串进行的过滤,所以如果过滤了or and的话,提交id=1和id=and1结果应该相同 http://localhost/sqli-labs-master/Less-25a/? ...
- webapi部署到IIS 404错误
环境:win2008r2+IIS 解决方案: 添加一个映射 可执行文件地址(根据系统决定64位可32位): C:\Windows\Microsoft.NET\Framework64\v4.0.3031 ...
- BZOJ 1688: [Usaco2005 Open]Disease Manangement 疾病管理 状压DP + 二进制 + 骚操作
#include <bits/stdc++.h> #define setIO(s) freopen(s".in","r",stdin) #defin ...
- BZOJ 5466: [Noip2018]保卫王国 动态DP
Code: // luogu-judger-enable-o2 #include<bits/stdc++.h> #define ll long long #define lson (now ...
- USACO 4.1 Fence Loops
Fence Loops The fences that surround Farmer Brown's collection of pastures have gotten out of contro ...
- C#第二节课
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...
- [luogu2317 HNOI2005] 星际贸易 (dp)
传送门 Solution 两个dp分开处理, 第一问什么都不考虑直接dp 第二问还有些疑惑,姑且先留坑 Code //By Menteur_Hxy #include <cstdio> #i ...
- shell脚本中source无效
发现在shell里面执行source,提示找不到命令.所以,我取搜了一些资料,总结一下. 一. 脚本中,source找不到命令--------------是因为用了sh执行脚本,而debian系统的s ...