HDU 4818 Golden Radio Base (2013长春现场赛B题)
题目链接: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题)的更多相关文章
- HDU 4816 Bathysphere (2013长春现场赛D题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4816 2013长春区域赛的D题. 很简单的几何题,就是给了一条折线. 然后一个矩形窗去截取一部分,求最 ...
- HDU 4759 Poker Shuffle(2013长春网络赛1001题)
Poker Shuffle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot ...
- HDU 4815 Little Tiger vs. Deep Monkey(2013长春现场赛C题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4815 简单的DP题. #include <stdio.h> #include <st ...
- HDU 4821 String(2013长春现场赛I题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4821 字符串题. 现场使用字符串HASH乱搞的. 枚举开头! #include <stdio.h ...
- HDU 4815 Little Tiger vs. Deep Monkey 2013 长春现场赛C题
链接:http://acm.hdu.edu.cn/showproblem.php?pid=4815 [题意] n个题目,每题有各自的分数,A有50%的概率答对一道题目得到相应分数,B想要在至少P的概率 ...
- hdu 4813(2013长春现场赛A题)
把一个字符串分成N个字符串 每个字符串长度为m Sample Input12 5 // n mklmbbileay Sample Outputklmbbileay # include <iost ...
- HDU 4763 Theme Section (2013长春网络赛1005,KMP)
Theme Section Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot ...
- 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 ...
- HDU 4768 Flyer (2013长春网络赛1010题,二分)
Flyer Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submi ...
随机推荐
- AngularJS入门基础——表达式
表达式在AngularJS应用中广泛的使用,因此深入理解AngularJS如何使用并运算表达式是非常重要的. 表达式和eval非常相似,但是由于表达式由AngularJS来处理,它们有已下显著不同 ...
- Docker学习笔记四 Docker容器
本文地址:https://www.cnblogs.com/veinyin/p/10439849.html 容器是独立运行的一个或一组应用及他们的运行态环境,对应虚拟机的操作系统和应用. 启动 可 ...
- 内置函数bytes()
a=b'\x00\x9c@c' print a[3]#99,c的ascii码是99 print a[1]#156 并且byte是无法修改的 c[1]=155 Traceback (most recen ...
- 【linux kernel】 中断处理-中断下半部【转】
转自:http://www.cnblogs.com/embedded-tzp/p/4453987.html 欢迎转载,转载时需保留作者信息,谢谢. 邮箱:tangzhongp@163.com 博客园地 ...
- 底板芯片组与内存映射(Motherboard Chipsets and the Memory Map) 【转】
转自:http://blog.chinaunix.net/uid-25909619-id-4194650.html 底板芯片组与内存映射 我打算写一些关于计算机内部构造(computer intern ...
- 利用shell找出15分钟内修改的文件
如果你的文件只是生成不会修改的话,可以这样: find * -mmin -15 2>/dev/null 如果可能修改,则需要这样(先创建一个 15 分之前的时间戳的文件,然后找比这个文件新的文件 ...
- CasperJS断言
特征 CasperJS具有一系列特征. 它具有一些列功能与断言,都是你期望一个好的测试API所具有的,包括: * assertTextExists (文本存在断言)* assertTitle (标题断 ...
- python里面的引用
1 对象及其引用 python中,引用是用命名空间来实现的,命名空间维护了变量和对象之间的引用关系. myInt = 27 yourInt = myInt #change the value of y ...
- java虚拟机规范(se8)——java虚拟机结构(二)
2.5 运行时数据区域 java虚拟机定义了多个用于程序执行期间的运行时数据区域.这些数据区域中一些随着java虚拟机的启动而创建,随着虚拟机的退出而销毁.其他的数据区域时和线程相关的.线程相关数据区 ...
- vue 数组
今天项目中发现的一个问题: 在vue项目中输出一个数组,明明有俩个值:0,6,但是length为1 正常的是这样的 结果研究发现,是vue源码的问题,具体内容如下: 转载自:http://www.cn ...