Codeforces Gym101606 J.Just A Minim (2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017))
J Just A Minim
超级无敌大水题,但是被精度卡了一手,输出要精确到小数点后6位,我直接输出的。。。
代码:
1 #include<iostream>
2 #include<cstdio>
3 #include<cstring>
4 #include<cmath>
5 #include<queue>
6 #include<set>
7 #include<algorithm>
8 #include<map>
9 using namespace std;
10 int a[2000+10];
11 int main(){
12 int n;
13 while(~scanf("%d",&n)){
14 double ans=0;
15 for(int i=0;i<n;i++){
16 scanf("%d",&a[i]);
17 if(a[i]==0)ans+=2;
18 if(a[i]==1)ans+=1;
19 if(a[i]==2)ans+=1.0/2;
20 if(a[i]==4)ans+=1.0/4;
21 if(a[i]==8)ans+=1.0/8;
22 if(a[i]==16)ans+=1.0/16;
23 }
24 printf("%.6f\n",ans);
25 }
26 return 0;
27 }
这场比赛不好玩,也懒得补题。。。
瞎写的题解,题解都不想写,但是代码都是对的,不是瞎写的。。。
溜了溜了,睡觉了,脑仁疼,今晚不是嗨到最晚的男人了_(:з」∠)_
Codeforces Gym101606 J.Just A Minim (2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017))的更多相关文章
- Codeforces Gym101606 A.Alien Sunset (2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017))
2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017) 寒假第一次组队训练赛,和学长一起训练,题目难度是3颗星,我和猪队友写 ...
- [寒假集训第一场]gym101606 2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017)
3星场 难度在于英文题面太难读懂了QAQ 看样例猜题意的我 博客园的c++主题真丑 A Alien Sunset \(description\) 有\(n\)个星球,每个星球自转时间不一样,所以一天的 ...
- 2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017)
A. Alien Sunset 暴力枚举答案即可. #include<cstdio> int n,i,mx; struct P{ int h,r,t; bool night(int x){ ...
- Codeforces Gym101606 E.Education (2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017))
E Education 这个题有点意思,就是找满足条件的最小价格里的最大值的人数,有点贪心的思想吧,一开始写错了,人群的那个不能排序,而且是最小价格里找能住下人最多的部门,让这个部门去住这个房间.在循 ...
- Codeforces Gym101606 C.Cued In (2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017))
C Cued In 这个题是打球的.都忘了写的什么了... 代码: 1 #include<iostream> 2 #include<cstring> 3 #include< ...
- Codeforces Gym101606 I.I Work All Day (2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017))
I I Work All Day 这个题就是取模找最小的. 代码: 1 #include<iostream> 2 #include<cstdio> 3 #include< ...
- Codeforces Gym101606 D.Deranging Hat (2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017))
D Deranging Hat 这个题简直了,本来想的是冒泡排序然后逆着输出来的,后来发现不对,因为题目上求的是最优解,而且冒泡的话,输出结果有的超出10000行了,所以就是把一开始的,排好序的字母标 ...
- 2019.04.11 第四次训练 【 2017 United Kingdom and Ireland Programming Contest】
题目链接: https://codeforces.com/gym/101606 A: ✅ B: C: ✅ D: ✅ https://blog.csdn.net/Cassie_zkq/article/ ...
- 2017 United Kingdom and Ireland Programming(Gym - 101606)
题目很水.睡过了迟到了一个小时,到达战场一看,俩队友AC五个了.. 就只贴我补的几个吧. B - Breaking Biscuits Gym - 101606B 旋转卡壳模板题.然后敲错了. 代码是另 ...
随机推荐
- 关于上传文件 非ajax提交 得到后台数据问题
<form name="configForm" id="configForm" method="post" action=" ...
- centos7.4进入单用户模式
centos7.4进入单用户模式 1 - 在启动grub菜单,选择编辑选项启动 2 - 按键盘e键,来进入编辑界面 3 - 找到Linux 16的那一行,将ro改为rw init=/sysroot/b ...
- matplotlib学习记录 五
# 绘制电影票房竖条形图 from matplotlib import pyplot as plt a = ["战狼2","速度与激情8","功夫瑜伽 ...
- (转)iOS获取设备型号
//获得设备型号 + (NSString *)getCurrentDeviceModel:(UIViewController *)controller { ]; size_t len; char *m ...
- 安装openstack同步数据库时出错解决方法
错误提示:(2003, "Can't connect to MySQL server on 'controller' ([Errno -2] Name or service not know ...
- cyg-apt update 升级报错
现象: $ cyg-apt updatecyg-apt: downloading: http://box-soft.com/setup-2.bz2cyg-apt: downloading: http: ...
- day18-socket 编程
1.Socket是网络上的使用的交互信息得方法,也叫套接字 用于描述IP地址和端口,是一个通信链的句柄,应用程序通常通过"套接字"向网络发出请求或者应答网络请求. 通讯原理 Soc ...
- 常见的Linux目录及其含义
/ 系统根目录,通常不会在这里存放文件 . /bin 二进制目录,存放许多 ...
- 玩App怎么赚钱(二)
紧接上篇文章,谈到App前赚钱的一些门道,其实还有很多了,需要你自己去挖掘App到底有什么价值.有价值的东西就能形成交易,而交易的过程中是用金钱作为流通手段,所以说赚钱没那么高大上,它的本质就是价值的 ...
- 25、Base64
Base64要求把每三个8Bit的字节转换为四个6Bit的字节(3*8 = 4*6 = 24),然后把6Bit再添两位高位0,组成四个8Bit的字节,也就是说,转换后的字符串理论上将要比原来的长1/3 ...