题目链接: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. J2EE简介

    一,J2EE概念: J2EE的全称为,Java2 Platform Enterprise Edition,Java或java2平台企业版,他是基于java平台或java2平台的标准版,保留并扩展了J2 ...

  2. if 语句 写了return 报错

  3. python的map/reduce区别

    直接上列子 map: 把f(x)作用在list的每一个元素并把结果生成一个新的list” # coding=utf-8def f(x): return x * x r = map(f, [1, 2, ...

  4. springcloud中的API网关服务Zuul

    到目前为止,我们Spring Cloud中的内容已经介绍了很多了,Ribbon.Hystrix.Feign这些知识点大家都耳熟能详了,我们在前文也提到过微服务就是把一个大的项目拆分成很多小的独立模块, ...

  5. (maven项目)使用java -jar命令遇到的小问题|xx.jar中没有主清单或Error:Invalid or corrupt jarfile xx.jar

    xx.jar中没有主清单或Error:Invalid or corrupt jarfile xx.jar 遇到这个问题,是因为你的jar包没有设置主类的入口. 即在META-INF文件夹的MANIFE ...

  6. 错误的理解引起的bug async await 执行顺序

    今天有幸好碰到一个bug,让我知道了之前我对await async 的理解有点偏差. 错误的理解 之前我一直以为  await 后面的表达式,如果是直接返回一个具体的值就不会等待,而是继续执行asyn ...

  7. 洛谷P3375KMP字符串匹配

    传送门 #include <iostream> #include <cstdio> #include <cstring> #include <algorith ...

  8. Python外部脚本调用Django项目Model表

    在实际生产中有时候会出现这种情况,原本运行了一个Django项目,后面又需要一些外部脚本进行辅助,而这些脚本又不希望集成到项目当中,但是又需要用到Django项目的Model,这时候是无法像在项目当中 ...

  9. 一步一步学习IdentityServer3 (4)

    其实上述例子 很多都很找到 但是在实际生态环境中给例子有很多不一样的地方 比如自定已登录界面怎么做? 怎么访问自己的用户数据库实现登录? 怎么在接口中使用,在接口中又怎么实现与Idr3结合授权? 等等 ...

  10. Java第三阶段学习(十、XML学习)

    一.XML学习 1.模拟Servlet执行 在学习完前端及java与数据库后,将进行WEB编程阶段的学习.在WEB编程中,可以通过浏览器访问WEB服务器上的数据.这时WEB服务器就相当于另一台计算机. ...