题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4814

进制转换。

现场根据题目给的两个公式,不断更新!!!

胡搞就可以了。

现场3A,我艹,一次循环开大TLE,一次开小WA,太逗了,呵呵

现场源码:

 #include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <math.h>
using namespace std;
int a[];
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int n;
while(scanf("%d",&n) == )
{
memset(a,,sizeof(a));
a[] = n;
for(int cc = ;cc <= ;cc++)
{
for(int i = ;i <= ;i++)
if(a[i] > && a[i+] > )
{
int MM = min(a[i],a[i+]);
a[i] -= MM;
a[i+] -= MM;
a[i+] += MM;
}
for(int i = ;i <= ;i++)
if(a[i] >= )
{
int pp = a[i]/;
a[i] %= ;
a[i+] += pp;
a[i-] += pp;
}
}
int st = ;
for(int i = ;i >= ;i--)
if(a[i] > )
{
st = i;
break;
}
int ed = ;
for(int i = ;i < ;i++)
if(a[i] > )
{
ed = i;
break;
}
for(int i = st;i >= ;i--)
{
printf("%d",a[i]);
}
if(ed < )printf(".");
for(int i = ;i >= ed;i--)
printf("%d",a[i]);
printf("\n");
}
return ;
}

HDU 4818 Golden Radio Base (2013长春现场赛B题)的更多相关文章

  1. HDU 4816 Bathysphere (2013长春现场赛D题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4816 2013长春区域赛的D题. 很简单的几何题,就是给了一条折线. 然后一个矩形窗去截取一部分,求最 ...

  2. HDU 4759 Poker Shuffle(2013长春网络赛1001题)

    Poker Shuffle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tot ...

  3. HDU 4815 Little Tiger vs. Deep Monkey(2013长春现场赛C题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4815 简单的DP题. #include <stdio.h> #include <st ...

  4. HDU 4821 String(2013长春现场赛I题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4821 字符串题. 现场使用字符串HASH乱搞的. 枚举开头! #include <stdio.h ...

  5. HDU 4815 Little Tiger vs. Deep Monkey 2013 长春现场赛C题

    链接:http://acm.hdu.edu.cn/showproblem.php?pid=4815 [题意] n个题目,每题有各自的分数,A有50%的概率答对一道题目得到相应分数,B想要在至少P的概率 ...

  6. hdu 4813(2013长春现场赛A题)

    把一个字符串分成N个字符串 每个字符串长度为m Sample Input12 5 // n mklmbbileay Sample Outputklmbbileay # include <iost ...

  7. HDU 4763 Theme Section (2013长春网络赛1005,KMP)

    Theme Section Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tot ...

  8. HDU 4762 Cut the Cake (2013长春网络赛1004题,公式题)

    Cut the Cake Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  9. HDU 4768 Flyer (2013长春网络赛1010题,二分)

    Flyer Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submi ...

随机推荐

  1. 【转】在Mac OS X 10.8中配置Apache + PHP + MySQL

    CHENYILONG Blog 在Mac OS X 10.8中配置Apache + PHP + MySQL 在Mac OS X 10.8中配置Apache+PHP+MySQL的内容包括: 配置Apac ...

  2. expect 交互 之双引号较长变量

    交互双引号较长变量  #!/bin/bash RemoteUser=xuesong12 Ip=192.168.1.2 RemotePasswd=xuesong Cmd="/bin/echo ...

  3. 【webService客户端】webservice客户端工具

    public static Object invokeWebService(String namespaces,String url, String method, Object[] params, ...

  4. Android Studio 新建drawable-hdpi、drawable-mdpi等

    在不同的模式“Project” / “Android”的文件夹中查看文件夹.如果文件夹丢失,您可以轻松添加它们. 1.在“res”文件夹上右键“New”->”Android Resource D ...

  5. 云计算-MapReduce

    Hadoop示例程序WordCount详解及实例http://blog.csdn.net/xw13106209/article/details/6116323 hadoop中使用MapReduce编程 ...

  6. pip2和pip3冲突问题解决方法

    python使用pip安装模块时报错:unable to create process using ' '的解决方法: 参考:http://qoogle.cn/?id=39 1.删除C:\Python ...

  7. House Robber I & II & III

    House Robber You are a professional robber planning to rob houses along a street. Each house has a c ...

  8. nginx 反向代理Apache

    2014年1月13日 18:15:25 同一个域名下,不同uri走不同的应用(不同的web根目录) 实现方式: Apache分别监听两个端口,对应不同的应用 nginx监听80端口,利用locatio ...

  9. jquery模型(外壳实现)

    详细解释: 1.现在传入的参数是window,document,可以知道是它俩引用 2. 3. 4.每次调用jquery方法,都会创建一个实例,但是内存并没有暴涨,原因是:jquery里面new 的这 ...

  10. 更换网页tab标题图标

    在首页HTML文件中,加入link命令,<link>是放在<head>与</head>之间 例如下面这样: <HEAD><link rel = & ...