The 3n + 1 problem
The 3n + 1 problem
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 32 Accepted Submission(s) : 15
#include <stdio.h>
#include <stdlib.h> int main()
{
long long T,N,i,sign,MAX,I,a,b;
while(scanf("%I64d%I64d",&T,&N)!=EOF)
{
a=(T<N)?T:N;
b=(T>N)?T:N;
for(i=a,MAX=;i<=b;i++)
{
I=i;
sign=;
while(I!=)
{
if(I%==)
{
I=*I+;
}
else
{
I=I/;
}
sign++;
}
if(MAX<sign)
MAX=sign;
}
printf("%I64d %I64d %I64d\n",T,N,MAX);
}
return ;
}
The 3n + 1 problem的更多相关文章
- UVa 100 - The 3n + 1 problem(函数循环长度)
题目来源:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&pa ...
- 烟大 Contest1024 - 《挑战编程》第一章:入门 Problem A: The 3n + 1 problem(水题)
Problem A: The 3n + 1 problem Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 14 Solved: 6[Submit][St ...
- The 3n + 1 problem 分类: POJ 2015-06-12 17:50 11人阅读 评论(0) 收藏
The 3n + 1 problem Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 53927 Accepted: 17 ...
- uva----(100)The 3n + 1 problem
The 3n + 1 problem Background Problems in Computer Science are often classified as belonging to a ...
- 【转】UVa Problem 100 The 3n+1 problem (3n+1 问题)——(离线计算)
// The 3n+1 problem (3n+1 问题) // PC/UVa IDs: 110101/100, Popularity: A, Success rate: low Level: 1 / ...
- 100-The 3n + 1 problem
本文档下载 题目: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_pro ...
- PC/UVa 题号: 110101/100 The 3n+1 problem (3n+1 问题)
The 3n + 1 problem Background Problems in Computer Science are often classified as belonging to a ...
- UVA 100 - The 3n+1 problem (3n+1 问题)
100 - The 3n+1 problem (3n+1 问题) /* * 100 - The 3n+1 problem (3n+1 问题) * 作者 仪冰 * QQ 974817955 * * [问 ...
- classnull100 - The 3n + 1 problem
新手发帖,很多方面都是刚入门,有错误的地方请大家见谅,欢迎批评指正 The 3n + 1 problem Background Problems in Computer Science are o ...
随机推荐
- javascript history对象
window.history.[属性|方法] 0.history对象记录了用户曾经浏览过的页面(URL),并可以实现浏览器前进与后退相似导航的功能. 1.属性 2.方法
- hdfs格式化hadoop namenode -format错误
在对HDFS格式化,执行hadoop namenode -format命令时,出现未知的主机名的问题,异常信息如下所示: [shirdrn@localhost bin]$ hadoop namenod ...
- Struts2第二天
Struts2第二天 昨天: 1.Action的编写方式:实现Action接口.继承ActionSupport.自定义pojo作为action 2.action调用方法:默认的execute.meth ...
- kali Rolling安装之后的一些常用配置总结
添加普通用户 useradd -m -G sudo,video,audio,cdrom -s /bin/bash OKing把某个用户添加到组中: sudo usermod -a 用户名 -G 组名 ...
- sublime text3编译运行C,Java程序的一些配置
环境:linux 64位 桌面环境: gnome Java编译运行 (1)Preferences --> Browse Packages --> 在该文件夹下新建build文件如: Myj ...
- droidcon 北京2016安卓技术大会——安卓领域国际盛会
目前droidcon国际技术大会已成为安卓领域全球最有影响力.规模最大的技术大会,每年在世界各地举办,横跨四大洲,超过上万人次参加. droidcon国际技术大会于2009年由一个Android爱好者 ...
- dplyr 数据操作 数据过滤 (filter)
在R的使用过程中我们几乎都绕不开Hadley Wickham 开发的几个包,前面说过的ggplot2.reshape2以及即将要讲的dplyr 因为这几个包可以非常轻易的使我们从复杂的数据操作中逃离, ...
- ggplot2 theme相关设置—文本调整
在geom设置和scale设置之后,要想把图画的漂亮,theme设置是比不可少的 在theme 设置中element_text()是一项很重要的内容 element_text(family = NUL ...
- pthread_create线程创建的过程剖析(转)
概述 在Linux环境下,pthread库提供的pthread_create()API函数,用于创建一个线程.线程创建失败时,它可能会返回ENOMEM或EAGAIN.这篇文章主要讨论线程创建过程中碰到 ...
- LeetCode OJ 1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific ta ...