結果

問題 No.3072 Sum of sqrt(x)
ユーザー tailstails
提出日時 2020-09-12 16:43:59
言語 cLay
(20240420-1)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 5,665 ms
コンパイル使用メモリ 163,828 KB
実行使用メモリ 5,252 KB
最終ジャッジ日時 2023-09-19 01:17:27
合計ジャッジ時間 114,826 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 4 ms
4,380 KB
testcase_03 AC 4 ms
4,376 KB
testcase_04 AC 4 ms
4,376 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 WA -
testcase_08 AC 762 ms
4,452 KB
testcase_09 AC 1,036 ms
4,560 KB
testcase_10 AC 1,667 ms
4,464 KB
testcase_11 AC 1,640 ms
4,464 KB
testcase_12 AC 1,594 ms
4,460 KB
testcase_13 AC 1,549 ms
4,512 KB
testcase_14 AC 1,550 ms
5,004 KB
testcase_15 AC 1,551 ms
5,008 KB
testcase_16 AC 1,787 ms
5,252 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 1,553 ms
4,684 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

vector<long double> q;
long double v,s;
ll n,x;
ll pb=10;int pi=16;

{
	rd(n);
	rep(n){
		rd(x);
		v=sqrtl(x);
		q.push_back(v);
		push_heap(q.begin(),q.end());
		if(q.size()>100){
			pop_heap(q.begin(),q.end());
			long double a=q.back();
			q.pop_back();
			pop_heap(q.begin(),q.end());
			long double b=q.back();
			q.pop_back();
			q.push_back(a+b);
		}
		s=0;
		for(long double w:q)s+=w;
		while(pb<s) pb*=10,pi--;
		printf("%.*Lf\n",pi,s);
	}
}
0