100MB=10^5KB=10^8B

100MB=100*2^10KB=100*2^20B

Sample Input
2
100[MB]
1[B]

Sample Output
Case #1: 4.63%
Case #2: 0.00%

  1. # include <iostream>
  2. # include <cstdio>
  3. # include <cstring>
  4. # include <algorithm>
  5. # include <string>
  6. # include <cmath>
  7. # include <queue>
  8. # include <list>
  9. # define LL long long
  10. using namespace std ;
  11.  
  12. char s[];
  13.  
  14. int change(char s[])
  15. {
  16. if(strcmp(s,"B]") == )return ;
  17. if(strcmp(s,"KB]") == )return ;
  18. if(strcmp(s,"MB]") == )return ;
  19. if(strcmp(s,"GB]") == )return ;
  20. if(strcmp(s,"TB]") == )return ;
  21. if(strcmp(s,"PB]") == )return ;
  22. if(strcmp(s,"EB]") == )return ;
  23. if(strcmp(s,"ZB]") == )return ;
  24. if(strcmp(s,"YB]") == )return ;
  25. }
  26.  
  27. int main()
  28. {
  29. //freopen("in.txt","r",stdin) ;
  30. int T ;
  31. scanf("%d" , &T) ;
  32. int Case = ;
  33. while(T--)
  34. {
  35. Case++ ;
  36. int x ;
  37. scanf("%d[%s" , &x , s) ;
  38. int t = change(s) ;
  39. double ans = pow(1000.0,t)/pow(1024.0,t) ;
  40. ans = - ans ;
  41. printf("Case #%d: %.2lf%%\n",Case,ans*);
  42.  
  43. }
  44.  
  45. return ;
  46. }

hdu 4788 (2013成都现场赛 H题)的更多相关文章

  1. 2013年省赛H题

    2013年省赛H题你不能每次都快速幂算A^x,优化就是预处理,把10^9预处理成10^5和10^4.想法真的是非常巧妙啊N=100000构造两个数组,f1[N],间隔为Af2[1e4]间隔为A^N,中 ...

  2. 2013杭州现场赛B题-Rabbit Kingdom

    杭州现场赛的题.BFS+DFS #include <iostream> #include<cstdio> #include<cstring> #define inf ...

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

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

  4. HDU 4800/zoj 3735 Josephina and RPG 2013 长沙现场赛J题

    第一年参加现场赛,比赛的时候就A了这一道,基本全场都A的签到题竟然A不出来,结果题目重现的时候1A,好受打击 ORZ..... 题目链接:http://acm.hdu.edu.cn/showprobl ...

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

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

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

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

  7. HDU 4818 Golden Radio Base (2013长春现场赛B题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4814 进制转换. 现场根据题目给的两个公式,不断更新!!! 胡搞就可以了. 现场3A,我艹,一次循环开 ...

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

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

  9. HDU 5119 Happy Matt Friends(2014北京区域赛现场赛H题 裸背包DP)

    虽然是一道还是算简单的DP,甚至不用滚动数组也能AC,数据量不算很大. 对于N个数,每个数只存在两个状态,取 和 不取. 容易得出状态转移方程: dp[i][j] = dp[i - 1][j ^ a[ ...

随机推荐

  1. C++ 注册表编程

    原文 C++ 注册表编程 1.基础知识 注册表的组织方式跟文件目录比较相似,主要分为根键.子键和键值项三部分,与文件目录对应的话就是根目录.子目录和文件.分别介绍一下这三部分: (1)根键.分为5个, ...

  2. GC的时机

    说到JVM,GC(垃圾回收)是非常重要的机制. 那么首先的问题是: GC在什么时候会发生? GC的触发包括两种情况:1.程序调用System.gc()的时候.2.系统自身决定是否需要GC. 系统进行G ...

  3. oracle进阶之分析函数

    本博客是自己在学习和工作途中的积累与总结,纯属经验之谈,仅供自己参考,也欢迎大家转载,转载时请注明出处. http://www.cnblogs.com/king-xg/p/6797119.html 分 ...

  4. [Baltic2009]Radio Transmission

    bzoj 1355: [Baltic2009]Radio Transmission http://www.lydsy.com/JudgeOnline/problem.php?id=1355 Time ...

  5. radioButton drawable selector

    1.实现radioButton drawable selector更改图片,在drawable文件夹下,新建selector文件, <selector xmlns:android="h ...

  6. HDU 4500 小Q系列故事——屌丝的逆袭

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4500 解题报告:简单题,数据范围不大,直接暴力每个点,然后再比较出得分最大的点的位置和分数. #inc ...

  7. sparse coding

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  8. VUE组件相关总结!

    定义使用一个组件 <!doctype html> <html lang="en"> <head> <meta charset=" ...

  9. python3之pymysql模块

    1.python3 MySQL数据库链接模块 PyMySQL 是在 Python3.x 版本中用于连接 MySQL 服务器的一个库,Python2中则使用mysqldb. PyMySQL 遵循 Pyt ...

  10. gcc编译选项【转】

    转自:https://blog.csdn.net/rheostat/article/details/19811407 常用选项 -E:只进行预处理,不编译-S:只编译,不汇编-c:只编译.汇编,不链接 ...