結果

問題 No.2462 七人カノン
ユーザー cho435cho435
提出日時 2023-09-08 22:55:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 738 bytes
コンパイル時間 4,524 ms
コンパイル使用メモリ 261,800 KB
実行使用メモリ 8,112 KB
最終ジャッジ日時 2023-09-08 22:55:52
合計ジャッジ時間 12,612 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
6,648 KB
testcase_01 AC 5 ms
6,768 KB
testcase_02 AC 4 ms
6,860 KB
testcase_03 AC 9 ms
6,676 KB
testcase_04 AC 9 ms
6,824 KB
testcase_05 AC 9 ms
6,616 KB
testcase_06 AC 10 ms
6,648 KB
testcase_07 AC 9 ms
6,768 KB
testcase_08 AC 9 ms
6,812 KB
testcase_09 AC 9 ms
6,720 KB
testcase_10 AC 9 ms
6,668 KB
testcase_11 AC 9 ms
6,608 KB
testcase_12 AC 10 ms
6,616 KB
testcase_13 AC 127 ms
7,704 KB
testcase_14 AC 135 ms
7,940 KB
testcase_15 AC 126 ms
7,948 KB
testcase_16 AC 144 ms
7,940 KB
testcase_17 AC 144 ms
8,052 KB
testcase_18 AC 52 ms
6,964 KB
testcase_19 AC 52 ms
6,916 KB
testcase_20 AC 132 ms
8,036 KB
testcase_21 AC 129 ms
7,936 KB
testcase_22 AC 132 ms
7,940 KB
testcase_23 AC 130 ms
7,928 KB
testcase_24 AC 99 ms
7,552 KB
testcase_25 AC 146 ms
8,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using mint = atcoder::modint998244353;

double op(double a,double b){
	return a+b;
}
double e(){
	return 0;
}

int main(){
	int n,q;
	cin>>n>>q;
	vector<int> I(q),S(q),T(q);
	rep(i,q) cin>>I.at(i)>>S.at(i)>>T.at(i);
	rep(i,q) I.at(i)--;
	vector<ll> sm(1e5+1,0);
	rep(i,q){
		sm.at(S.at(i))++;
		sm.at(T.at(i))--;
	}
	rep(i,1e5) sm.at(i+1)+=sm.at(i);
	atcoder::segtree<double,op,e> seg(1e5);
	rep(i,1e5) if(sm.at(i)>0) seg.set(i,(double)1/sm.at(i));
	vector<double> ans(n,0);
	rep(i,q){
		ans.at(I.at(i))+=seg.prod(S.at(i),T.at(i));
	}
	cout<<fixed<<setprecision(10);
	rep(i,n) cout<<ans.at(i)<<"\n";
}
0