Codeforces Round #370 (Div. 2)
来源:互联网 发布:文网文添加域名 编辑:程序博客网 时间:2024/06/05 23:03
题意:将一个大的等边三角形变为小的等边三角形,最小需要几步
思路:倒过来考虑,每次把最小的边尽可能的变大即可。
#include<bits/stdc++.h>using namespace std;typedef long long LL;#define mod 1000000007const int maxn=100005;int a[4];int x,y;int main(){ scanf("%d%d",&x,&y); for(int i=0;i<3;i++) a[i]=y; int ans=0; while(a[0]!=x){ a[0]=min(x,a[1]+a[2]-1); sort(a,a+3); ans++; } cout<<ans<<endl; return 0;}
0 0
- Codeforces Round #370 (Div. 2)
- Codeforces Round #370 (Div. 2)
- Codeforces Round #370 (Div. 2)
- 【codeforces】Codeforces Round #370 (Div. 2) C
- Codeforces Round #370 (Div. 2) C 贪心
- Codeforces Round #370 (Div. 2) 山寨题解
- CodeForces Round #370 (div.2) 即 Codeforces 712
- Codeforces Round #102 (Div. 2)
- Codeforces Round #103 (Div. 2)
- Codeforces Round #103 (Div. 2)
- Codeforces Round #104 (Div. 2)
- Codeforces Round #105 (Div. 2)
- Codeforces Round #105 (Div. 2)
- Codeforces Round #107 (Div. 2)
- Codeforces Round #108 (Div. 2)
- Codeforces Round #110 (Div. 2)
- Codeforces Round #122 (Div. 2)
- Codeforces Round #121 (Div. 2)
- Vue.js——60分钟webpack项目模板快速入门【8】
- 二叉树的非递归遍历
- 《自控力》阅读笔记二
- Vue.js——vue-router 60分钟快速入门【9】
- openId导致的微信中“下单账号和支付账号不一致”原因及解决办法
- Codeforces Round #370 (Div. 2)
- Vert.x - Java 的新领土
- Aurora一些使用过程中碰到的问题
- POJ 2513 字典树+一笔画问题
- Could not get lock
- 浅析Java集合类源码(一)--- Vector, ArrayList, LinkedList
- 四位数字插空格
- 酷酷的CSS3三角形运用
- poj 1408 Fishnet