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. Android——4.2 - 3G移植之路之 AT 通信 (四)

    在前文Android--4.2 - 3G移植之路之 reference-ril .pppd 拨号上网 (三)中分析了3G连接网络的流程,当中有说道通过AT指令建立连接, 在这里记录一下3G中的AT通信 ...

  2. 解决MAC下PHP连接MYSQL错误Warning: mysql_connect(): No such file or directory in conn.php

    今天在mac上用php去连接mysql数据库,出现了 mac PHP Warning:  mysql_connect(): [2002] No such file... 详细例如以下所看到的: Dir ...

  3. XMPP使用简单介绍--登录

    在现阶段的通信服务中,各种标准都有.因此会出现无法实现相互连通,而XMPP(Extensible Message and presence Protocol)协议的出现,实现了整个及时通信服务协议的互 ...

  4. CentOS6 安装 aria2

    CentOS6 安装 aria2 https://www.jianshu.com/p/31ea7aba5524 http://blog.51cto.com/skypegnu1/1637168 1.先安 ...

  5. Lesson 1 Basic Concepts: Part 1

    www.how-to-build-websites.com/basic-concepts/part1.php An introduction to domain names, web servers, ...

  6. js插件---图片裁剪cropImgBox(适合练习编写插件之用)

    js插件---图片裁剪cropImgBox(适合练习编写插件之用) 一.总结 一句话总结:无论是灰度还是高对比度的图片,都是先处理canvas的像素,使其变成灰度或者高对比度,然后再用canvas.t ...

  7. Day2代码

    #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #defi ...

  8. 关于viewport详解

  9. 关于props default 数组/对象的默认值应当由一个工厂函数返回

    export default {props: { xAxisData: {   type: Array,   default: [] }, },这是我的代码 报错是Invalid default va ...

  10. Windows 一键关闭UAC、防火墙、IE配置脚本

    有时候,在环境需求下,需要关闭windows防火墙,UAC,以及IE选项配置. 对不懂电脑来说是比较麻烦的,老是得教他们,关键还记不住…… so,以下脚本就可以解决这个问题 注:脚本 需要右键 以管理 ...