The 3n + 1 problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22148    Accepted Submission(s): 8276 Problem Description Problems in Computer Science are often classified as belonging to a c…
The 3n + 1 problem Problem Description Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classificat…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1032 Problem Description Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property…
还以为要递归推一推的 结果暴力就过了 要注意 i,j 大小 #include <iostream> using namespace std; int a,b; long long cnt,n,ans; int main() { while(~scanf("%d%d",&a,&b)) { ans=; int p=a,q=b; if(p>q) swap(p,q); for(int i=p;i<=q;i++) { cnt=; n=i; ) { cnt+…
果然集训就是学长学姐天天传授水铜的动态规划和搜索,今天讲DP由于困意加上面瘫学长"听不懂就是你不行"的呵呵传授,全程梦游.最后面对连入门都算不上的几道动态规划,我的内心一片宁静,甚至有一丝的想笑. 弱鸡第一次写博客,来分享一些对汉诺塔问题的理解吧: http://www.cnblogs.com/fanzhidongyzby/archive/2012/07/28/2613173.html 遵从tls"遇到不懂问题就xjb乱搜"原则,搜到了这篇文章.看完之后基本有了点眉…
The 3n + 1 problem Problem Description Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classificat…
一.Description Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all…
An easy problem Time Limit: 8000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 467    Accepted Submission(s): 258 Problem Description One day, a useless calculator was being built by Kuros. Let's assume that…
题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5170 bc(中文):http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=567&pid=1001 题解: 先用java大数幂写的,t了 import java.util.*; import java.math.*; public class Main { public static void main(St…
 题目链接 //巨坑的一道题,输入的m,n要判断大小,输出还要按照原来的顺序,范围还是i<=n<=j #include <iostream> #include <cstdio> #include <algorithm> using namespace std; int alro(int x) { ; ) { ) x = *x+; ; ct++; } return ct; } int main() { int m,n; while (cin>>m&…
Problem A: The 3n + 1 problem Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 14  Solved: 6[Submit][Status][Web Board] Description Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. I…
 The 3n + 1 problem  Background Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is…
HDU 4974 A simple water problem pid=4974" target="_blank" style="">题目链接 签到题,非常easy贪心得到答案是(sum + 1) / 2和ai最大值的最大值 代码: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N =…
The 3n + 1 problem Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 60496   Accepted: 19218 Description Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In th…
题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=2147 Problem Description Recently kiki has nothing to do. While she is bored, an idea appears in his mind, she just playes the checkerboard game.The size of the chesserboard is n*m.First of all, a coin i…
http://acm.hdu.edu.cn/showproblem.php? pid=1032 这题能够用暴力求解.求出在[ni,nj]之间全部数字产生的最大值. 通过观察能够知道,当nk靠近nj的时候,产生的值越多,于是,我认为能够在暴力的基础上做一些小的变化.降低对ni,nj中值得考查 #include <stdio.h> int main() { int m,n,i,max,count,t,j; while(scanf ("%d %d",&m,&n)!…
题目来源:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=36  The 3n + 1 problem  Background Problems in Computer Science are often classified as belonging to a certain class of problem…
Fire Net Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5863    Accepted Submission(s): 3280 Problem Description Suppose that we have a square city with straight streets. A map of a city is a s…
The 3n + 1 problem Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 53927   Accepted: 17142 Description Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In th…
 The 3n + 1 problem  Background Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is…
HDU 2096 /* HDU 2096 小明A+B --- 水题 */ #include <cstdio> int main() { #ifdef _LOCAL freopen("D:\\input.txt", "r", stdin); #endif int a, b, c, n; scanf("%d", &n); while (n--){ scanf("%d%d", &a, &b); a…
// The 3n+1 problem (3n+1 问题) // PC/UVa IDs: 110101/100, Popularity: A, Success rate: low Level: 1 // Verdict: Accepted // Submission Date: 2011-05-22 // UVa Run Time: 0.032s // // 版权所有(C)2011,邱秋.metaphysis # yeah dot net. // // [问题描述] // 考虑如下的序列生成算法…
本文档下载 题目: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=36 1 The 3n + 1 problem Time limit: 3.000 seconds 2 注意 中间的计算结果会大于INT_MAX,所以应该使用long long 来存储n 输入的i,j,不一定i < j 3 分析 本体考查的是穷举法+DP,还有能否优化程…
HDU 1248 寒冰王座(全然背包:入门题) http://acm.hdu.edu.cn/showproblem.php?pid=1248 题意: 不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,仅仅有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前. 死亡骑士:"我要买道具!" 地精商人:"我们这里有三种道具,血瓶150块一个,魔法药200块一个,无敌药水350块一个." 死亡骑士:"好的,给我一个血…
100 - The 3n+1 problem (3n+1 问题) /* * 100 - The 3n+1 problem (3n+1 问题) * 作者 仪冰 * QQ 974817955 * * [问题描述] * 考虑如下的序列生成算法:从整数 n 开始,如果 n 是偶数,把它除以 2:如果 n 是奇数, * 把它乘 3 加1.用新得到的值重复上述步骤,直到 n = 1 时停止. * 例如,n = 22 时该算法生成的序列是: * 22,11,34,17,52,26,13,40,20,10,5,…
这个问题并计算质数了一下相间隔似的.思想上一致. 注意问题: 1 i 可能 大于或等于j -- 这里上传.小心阅读题意,我没有说这个地方不能保证.需要特殊处理 2 计算过程中可能溢出,的整数大于最大值,需要使用long long 关于效率和时间问题: 1 能够使用数组保存中间结果,这样执行快了.内存消耗大了, 2 能够不使用中间数组. 这样执行肯定比較慢了.可是内存消耗小,一样能够AC的. 全部没有个标准吧.看情况而定.假设须要速度就添加数组,假设省内存就不使用数组吧. 这样的题目一般都使用数组…
主题链接:http://acm.hdu.edu.cn/showproblem.php?pid=5055 Problem Description Recently, Bob has been thinking about a math problem. There are N Digits, each digit is between 0 and 9. You need to use this N Digits to constitute an Integer. This Integer need…
新手发帖,很多方面都是刚入门,有错误的地方请大家见谅,欢迎批评指正  The 3n + 1 problem  Background Problems in Computer Science are often classified as belonging to acertain class of problems (e.g., NP, Unsolvable, Recursive). In thisproblem you will be analyzing a property of an al…
HDU 5572 An Easy Physics Problem (计算几何) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5572 Description On an infinite smooth table, there's a big round fixed cylinder and a little ball whose volume can be ignored. Currently the ball stands still at p…
The 3n + 1 problem Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 32   Accepted Submission(s) : 15 Problem Description Problems in Computer Science are often classified as belonging to a certain…