Time Limit:2s Memory Limit:128MByte

Submissions:1599Solved:270

DESCRIPTION

You have a sequence anan, which satisfies:

Now you should find the value of ⌊10an⌋⌊10an⌋.

INPUT
The input includes multiple test cases. The number of test case is less than 1000. Each test case contains only one integer n(1≤n≤109)n(1≤n≤109)。
OUTPUT
For each test case, print a line of one number which means the answer.
SAMPLE INPUT
5
20
1314
SAMPLE OUTPUT
5
21
1317
官方题解
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
ll n,i;
ll quick_pow(ll a,ll b)
{
ll ans=;
while(b)
{
if(b&) ans=ans*a;
b>>=;
a*=a;
}
return ans;
}
int main()
{
while(scanf("%lld",&n)!=EOF)
{
if(n<=) {printf("%lld\n",n);continue;}
for(i=;i<=;i++)
{
if(quick_pow(,i)-i+<=n && quick_pow(,i+)-i>=n)
{
printf("%lld\n",n+i);
break;
}
}
}
return ;
}

玲珑杯 Round 19 A simple math problem的更多相关文章

  1. A Simple Math Problem 矩阵打水题

    A Simple Math Problem Lele now is thinking about a simple function f(x).If x < 10 f(x) = x.If x & ...

  2. hdu 1757 A Simple Math Problem (乘法矩阵)

    A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Ot ...

  3. HDU1757 A Simple Math Problem 矩阵快速幂

    A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Ot ...

  4. hdu------(1757)A Simple Math Problem(简单矩阵快速幂)

    A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Ot ...

  5. FZYZ-2071 A Simple Math Problem IX

    P2071 -- A Simple Math Problem IX 时间限制:1000MS      内存限制:262144KB 状态:Accepted      标签:    数学问题-博弈论    ...

  6. A Simple Math Problem(矩阵快速幂)(寒假闭关第一题,有点曲折啊)

    A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other ...

  7. HDU 1757 A Simple Math Problem (矩阵快速幂)

    题目 A Simple Math Problem 解析 矩阵快速幂模板题 构造矩阵 \[\begin{bmatrix}a_0&a_1&a_2&a_3&a_4&a ...

  8. HDU 1757 A Simple Math Problem(矩阵)

    A Simple Math Problem [题目链接]A Simple Math Problem [题目类型]矩阵快速幂 &题解: 这是一个模板题,也算是入门了吧. 推荐一个博客:点这里 跟 ...

  9. HDU 1757 A Simple Math Problem (矩阵乘法)

    A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Ot ...

随机推荐

  1. openGl超级宝典学习笔记 (2) 7个主要的几何图元

    点(GL_POINTS): 点总是正方形的像素,默认情况下,点的大小不受透视除法影响. 即无论与视点的距离怎样,它的大小都不改变.为了获得圆点.必须在抗锯齿模式下绘制点. 能够用glPointSize ...

  2. uva 104 Arbitrage (DP + floyd)

    uva 104 Arbitrage Description Download as PDF Background The use of computers in the finance industr ...

  3. Servlet具体解释

    Servlet具体解释 基本概述 Session在计算机中,尤其是在网络应用中,称为"会话控制".在计算机专业术语中.Session是指一个终端用户与交互系统进行通信的时间间隔,通 ...

  4. android系统又一次刷ROM简记(一)

    当须要对android系统进行大刀阔斧的改造的时候,应该清晰的了解android各个image的组成才干做到庖丁解牛. 首先在android烧写过程中须要烧写的文件主要包含uboot.bin\boot ...

  5. Vue进阶之表单控件绑定

    1.单行input <html> <head> <meta charset="UTF-8"> <meta name="viewp ...

  6. 分享一个tom大叔的js 深入理解系列 (有助于提升)

    http://www.cnblogs.com/TomXu/archive/2011/12/15/2288411.html#3620172

  7. Ubuntu下通过Firefox Opera Chromium浏览器直接执行java应用程序(打开java jnlp文件)实现在服务器远程虚拟控制台完成远程管理的方法

    远程虚拟控制台依赖于java运行环境(jre),在通过浏览器打开链接前,系统必须安装jre环境,远程管理控制台其实就是一个java程序,打开相应的网站会下载一个jnlp(java网络加载协议)的文件, ...

  8. Copying GC (Part two :Multi Space Copying GC)

    目录 近似深度优先搜索方法 Cheney的GC复制算法 前提 执行结果 多空间复制算法 multi_space_copying()函数 mark_or_copy() copy() 执行过程 优缺点 近 ...

  9. HDU 1668 Islands and Bridges

    Islands and Bridges Time Limit: 4000ms Memory Limit: 65536KB This problem will be judged on HDU. Ori ...

  10. leetcode第一刷_Scramble String

    字符串的好题. 题干解释的很复杂.一下让人不知所措了. 这道题究竟是什么意思呢?终于的结果是把一个字符串中字母的顺序打乱了,让你推断一个字符串能不能由还有一个字符串打乱得到.那打乱这个过程是怎么做的呢 ...