結果

問題 No.2010 Magical Floor
ユーザー tails
提出日時 2022-07-15 23:17:03
言語 cLay
(20241019-1)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 3,188 ms
コンパイル使用メモリ 176,488 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 20:40:21
合計ジャッジ時間 4,150 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@t;
rep(t){
	ll@n;
	double@x,@h[n],@a[n];
	double z=1e99;
	rrep(i,1,n){
		h[i]-=h[i-1];
	}
	rep(i,n){
		double w=0,p=0;
		rep(j,i){
			if(a[i]>=a[j]){
				break_continue;
			}
			double r=a[i]/a[j];
			double t=r/sqrt(1-r*r);
			p+=t*h[j];
			w+=hypot(t,1)*h[j]*a[j];
		}
		if(x/2-p<0) continue;
		w+=(x/2-p)*a[i];
		z<?=w;
	}
	wt(2z);
}
0