/ SB域 /

记录详情

Accepted


  
# 状态 耗时 内存占用
#1 Accepted 3ms 384.0 KiB
#2 Accepted 2ms 384.0 KiB
#3 Accepted 4ms 360.0 KiB
#4 Accepted 3ms 348.0 KiB
#5 Accepted 30ms 356.0 KiB
#6 Accepted 62ms 384.0 KiB
#7 Accepted 88ms 508.0 KiB
#8 Accepted 124ms 596.0 KiB
#9 Accepted 144ms 768.0 KiB
#10 Accepted 2ms 384.0 KiB

代码

#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <queue>
#define R register
#define eps 1e-12
#define INF (1<<30)
#define LL long long
#define MM(x, y) memset(x, y, sizeof x)
#define Fo(i, x, y) for(R int i=x; i<=y; ++i)
#define Ro(i, x, y) for(R int i=x; i>=y; --i)
using namespace std;
template<typename T> inline T Max(R T x, R T y) {return x > y ? x : y;}
template<typename T> inline T Min(R T x, R T y) {return x < y ? x : y;}
template<typename T> inline void in(R T &x)
{
    static int ch; static bool flag;
    for(flag=false, ch=getchar(); ch<'0'||ch>'9'; ch=getchar()) flag |= ch=='-';
    for(x=0; ch>='0'&&ch<='9'; ch=getchar()) x = (x<<1) + (x<<3) + ch - '0';
    x = flag ? -x : x;
}
/*******************************Samle****************************************/

int n;
double ans, A[5050005];

int main()
{
    in(n);
    Fo(i, 1, n)
    {
        R double now = 0;
        R int from = Max(i-850, 1);
        Fo(j, from, i-1)
        {
            R double p = (A[j] + now) * 0.5;
            A[j] = now = p;
        }
        A[i] = 100;
        ans += (4200 * (100 - now)) / (1.0 * n);
    }
    printf("%.2lf\n", ans);
    return 0;
}


信息

递交者
类型
递交
题目
烧水问题
题目数据
下载
语言
C++
递交时间
2018-02-02 19:11:11
评测时间
2018-02-02 19:11:11
评测机
分数
100
总耗时
468ms
峰值内存
768.0 KiB