【bzoj1666】 [Usaco2006 Oct]Another Cow Number Game 奶牛的数字游戏
来源:互联网 发布:python数据挖掘实战pdf 编辑:程序博客网 时间:2024/06/08 10:36
题目传送门
题解 : 懒得写了 xjb模拟
#include<bits/stdc++.h>#define ll long longconst int INF = 0x7fffffff;const double eps = 1e-5;using namespace std;int read(){int x = 0 , f = 1; char ch = getchar();while(ch<'0'||ch>'9') {if(ch=='-')f*=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+(ch-'0');ch=getchar();}return x * f;}int n,ans;int main(){n = read();while( n ^ 1){++ans;if(n&1) n=n*3+1;else n>>=1;}printf("%d",ans);return 0;}
阅读全文
0 0
- bzoj1666[Usaco2006 Oct]Another Cow Number Game 奶牛的数字游戏
- 【bzoj1666】 [Usaco2006 Oct]Another Cow Number Game 奶牛的数字游戏
- [Usaco2006 Oct]Another Cow Number Game 奶牛的数字游戏 记忆化搜索
- BZOJ 1666: [Usaco2006 Oct]Another Cow Number Game 奶牛的数字游戏
- BZOJ_P1666 [Usaco2006 Oct]Another Cow Number Game 奶牛的数字游戏(hhhhhh)
- 1666: [Usaco2006 Oct]Another Cow Number Game 奶牛的数字游戏
- bzoj1669 [Usaco2006 Oct]Hungry Cows饥饿的奶牛
- [BZOJ1669][Usaco2006 Oct]Hungry Cows饥饿的奶牛
- BZOJ1669: [Usaco2006 Oct]Hungry Cows饥饿的奶牛
- 1669: [Usaco2006 Oct]Hungry Cows饥饿的奶牛
- BZOJ1669: [Usaco2006 Oct]Hungry Cows饥饿的奶牛
- bzoj 1669: [Usaco2006 Oct]Hungry Cows饥饿的奶牛 暴力
- bzoj 1669: [Usaco2006 Oct]Hungry Cows饥饿的奶牛
- BZOJ1669 [Usaco2006 Oct]Hungry Cows饥饿的奶牛
- bzoj1669 [Usaco2006 Oct]Hungry Cows饥饿的奶牛
- bzoj1668 [Usaco2006 Oct]Cow Pie Treasures 馅饼里的财富
- 1668: [Usaco2006 Oct]Cow Pie Treasures 馅饼里的财富
- bzoj1668 [Usaco2006 Oct]Cow Pie Treasures 馅饼里的财富
- CodeForces
- 《深入理解java虚拟机》学习笔记8—— java虚拟机性能监控与故障处理工具
- myeclipse启动tomcat遇到Server at localhost was unable to start within 45 seconds的问题
- AVL(平衡)树的旋转
- Shell注释
- 【bzoj1666】 [Usaco2006 Oct]Another Cow Number Game 奶牛的数字游戏
- HDU 1200 To and Fro
- 动态规划——486. Predict the Winner[Medium]
- JS出错注意点
- Github 提交文件
- 【浅谈折半搜索】POJ1186[方程的解数]题解
- 映射
- JAVA中ListIterator和Iterator详解与辨析
- Struts2 源码分析——Action代理类的工作