UVa11714 - Blind Sorting

简介: UVa11714 - Blind Sorting
#include <iostream>#include <cmath>#include <fstream>usingnamespacestd;
intmain()
{
intn;
#ifndef ONLINE_JUDGEifstreamfin("d:\\OJ\\uva_in.txt");
streambuf*old=cin.rdbuf(fin.rdbuf());
#endifwhile (cin>>n) {
cout<<n+ (int)ceil(log2(n)) -2<<endl;
    }
#ifndef ONLINE_JUDGEcin.rdbuf(old);
#endifreturn0;
}
目录
相关文章
UVa1531 - Problem Bee
UVa1531 - Problem Bee
59 0
UVa389 - Basically Speaking
UVa389 - Basically Speaking
41 0
uva673 Parentheses Balance
uva673 Parentheses Balance
54 0
|
机器学习/深度学习
1257:Knight Moves 2021-01-09
1257:Knight Moves 2021-01-09
|
机器学习/深度学习 算法
917:Knight Moves
题目链接:http://noi.openjudge.cn/ch0205/917/ 原题应该是hdu 1372 总时间限制: 1000ms  内存限制: 65536kB 描述 BackgroundMr Somurolov, fabulous chess-gamer indeed, asserts ...
1054 0
[Algorithms] Longest Increasing Subsequence
The Longest Increasing Subsequence (LIS) problem requires us to find a subsequence t of a given sequence s, such that t satisfies two requirements: ...
789 0
uva 100 The 3n+1 problem
题目链接: http://www.programming-challenges.com/pg.php?page=studenthome /* The 3n+1 problem 计算每个数的循环节长度,求给定区间的循环节长度的最大值。 */ #include&lt;iostream&gt; #include&lt;stdio.h&gt; using namespace std;
1171 0

热门文章

最新文章