結果

問題 No.2462 七人カノン
ユーザー tailstails
提出日時 2023-09-08 22:52:53
言語 cLay
(20240104-1)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 4,171 ms
コンパイル使用メモリ 162,856 KB
実行使用メモリ 10,596 KB
最終ジャッジ日時 2023-09-08 22:53:06
合計ジャッジ時間 11,556 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,632 KB
testcase_01 AC 2 ms
4,424 KB
testcase_02 AC 3 ms
4,376 KB
testcase_03 AC 4 ms
5,236 KB
testcase_04 AC 3 ms
5,184 KB
testcase_05 AC 3 ms
5,176 KB
testcase_06 AC 3 ms
5,264 KB
testcase_07 AC 4 ms
5,180 KB
testcase_08 AC 3 ms
5,264 KB
testcase_09 AC 3 ms
5,248 KB
testcase_10 AC 3 ms
5,292 KB
testcase_11 AC 3 ms
5,216 KB
testcase_12 AC 3 ms
5,168 KB
testcase_13 AC 35 ms
10,228 KB
testcase_14 AC 41 ms
10,176 KB
testcase_15 AC 36 ms
10,024 KB
testcase_16 AC 41 ms
10,324 KB
testcase_17 AC 62 ms
10,596 KB
testcase_18 AC 34 ms
6,212 KB
testcase_19 AC 33 ms
6,148 KB
testcase_20 AC 39 ms
9,796 KB
testcase_21 AC 39 ms
9,760 KB
testcase_22 AC 39 ms
9,796 KB
testcase_23 AC 40 ms
9,536 KB
testcase_24 AC 37 ms
9,056 KB
testcase_25 AC 41 ms
10,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@n,@q,i[q],s[],t[],g[1d5+1],b=0;
rd((i,s,t)(q));
rep(j,q){
	g[s[j]]+=1;
	g[t[j]]-=1;
}
double a=0,h[],f[n]{};
rep(k,1d5+1){
	h[k]=a+=b?1.0/b:0;
	b+=g[k];
}
rep(j,q){
	f[i[j]-1]+=h[t[j]]-h[s[j]];
}
wtLn(f(n));
0