/ SB域 /

记录详情

Accepted


  
# 状态 耗时 内存占用
#1 Accepted 2ms 376.0 KiB
#2 Accepted 2ms 384.0 KiB
#3 Accepted 2ms 384.0 KiB
#4 Accepted 3ms 364.0 KiB
#5 Accepted 18ms 376.0 KiB
#6 Accepted 22ms 504.0 KiB
#7 Accepted 60ms 384.0 KiB
#8 Accepted 141ms 572.0 KiB
#9 Accepted 225ms 640.0 KiB
#10 Accepted 3ms 356.0 KiB

代码

#include <iostream>
#include <stdio.h>
#include <algorithm>
#define II int
#define DO double
#define IL inline
#define R register
#define I 5234560
using namespace std;

IL void of(R II &a) {
	R char c=getchar(); R II w=1, p=0;
	while (c<'0' || c>'9') { if(c=='-') w=-1; c=getchar(); }
	while (c>='0' && c<='9') { p=p*10+c-'0'; c=getchar(); }
	a=w*p;
}

/* -------------------- Peipei -------------------- */

II n;
DO ans;
DO T[I];

int main()
{
	of(n);
	for(R II i=1;i<=n;i++) {
		ans+=(DO) ((100-T[i])*4200.0) / (DO) n;
		T[i]=100;
		for(R II j=i+1;j<=n;j++) {
			R DO now=(T[i]+T[j])*0.5;
			if(now<=1e-6) break ;
			T[i]=T[j]=now;
		}
	}
	
	printf("%.2lf\n",ans);
	exit(0);
}

信息

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