• 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
    ",ans);
    25     }
    26     return 0;
    27 }

    这场比赛不好玩,也懒得补题。。。

    瞎写的题解,题解都不想写,但是代码都是对的,不是瞎写的。。。

    溜了溜了,睡觉了,脑仁疼,今晚不是嗨到最晚的男人了_(:з」∠)_ 

  • 相关阅读:
    老罗的OLLYMACHINE
    VGA寄存器一览表
    常用的I/O地址
    使用VESA示例
    打开A20
    Linux 2.2 Framebuffer Device Programming Tutorial
    Linux驱动
    基于Linux核心的汉字显示的尝试
    汉字的动态编码与显示方案
    AT&T语法(一)
  • 原文地址:https://www.cnblogs.com/ZERO-/p/9703449.html
Copyright © 2020-2023  润新知