結果

問題 No.2462 七人カノン
ユーザー tailstails
提出日時 2023-09-08 21:55:51
言語 cLay
(20240104-1)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 6,493 ms
コンパイル使用メモリ 210,848 KB
実行使用メモリ 11,480 KB
最終ジャッジ日時 2023-09-08 21:56:06
合計ジャッジ時間 14,696 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 56 ms
10,656 KB
testcase_14 AC 61 ms
10,784 KB
testcase_15 AC 56 ms
10,692 KB
testcase_16 AC 65 ms
11,272 KB
testcase_17 AC 63 ms
11,480 KB
testcase_18 AC 32 ms
5,596 KB
testcase_19 AC 32 ms
5,512 KB
testcase_20 AC 64 ms
11,172 KB
testcase_21 AC 66 ms
11,296 KB
testcase_22 AC 66 ms
11,280 KB
testcase_23 AC 65 ms
11,424 KB
testcase_24 AC 47 ms
8,704 KB
testcase_25 AC 62 ms
11,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

typedef pair<ll,pair<ll,ll>>P;
ll@n,@q,j=0;
P b[2q];
rep(q){
	ll@i,@s,@t;
	b[j++]={s,{0,i}};
	b[j++]={t,{1,i}};
}
sortA(2q,b);
ll u=0,k=0;
double a=0;
double z[n]{};
rep(j,2q){
	auto p=b[j];
	if(k){
		a+=1.0*(p.first-u)/k;
	}
	if(p.second.first){
		z[p.second.second-1]-=a;
		++k;
	}else{
		z[p.second.second-1]+=a;
		--k;
	}
	u=p.first;
}
wtLn(z(n));
0