結果

問題 No.2462 七人カノン
ユーザー AerenAeren
提出日時 2023-09-08 21:31:21
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 1,168 bytes
コンパイル時間 3,648 ms
コンパイル使用メモリ 364,744 KB
実行使用メモリ 6,256 KB
最終ジャッジ日時 2023-09-08 21:31:42
合計ジャッジ時間 11,480 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,380 KB
testcase_01 AC 3 ms
4,404 KB
testcase_02 AC 3 ms
4,376 KB
testcase_03 AC 4 ms
4,380 KB
testcase_04 AC 4 ms
4,400 KB
testcase_05 AC 4 ms
4,380 KB
testcase_06 AC 4 ms
4,380 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 AC 4 ms
4,400 KB
testcase_09 AC 4 ms
4,376 KB
testcase_10 AC 4 ms
4,384 KB
testcase_11 AC 4 ms
4,376 KB
testcase_12 AC 4 ms
4,380 KB
testcase_13 AC 70 ms
5,964 KB
testcase_14 AC 79 ms
5,908 KB
testcase_15 AC 71 ms
5,928 KB
testcase_16 AC 82 ms
6,248 KB
testcase_17 AC 82 ms
6,172 KB
testcase_18 AC 53 ms
4,860 KB
testcase_19 AC 54 ms
4,852 KB
testcase_20 AC 77 ms
6,216 KB
testcase_21 AC 77 ms
6,172 KB
testcase_22 AC 79 ms
6,256 KB
testcase_23 AC 76 ms
6,248 KB
testcase_24 AC 68 ms
5,664 KB
testcase_25 AC 83 ms
6,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <x86intrin.h>
using namespace std;
using namespace numbers;



int main(){
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(ios::badbit | ios::failbit);
	cout << fixed << setprecision(15);
	int n, qn;
	cin >> n >> qn;
	vector<array<int, 3>> q(qn);
	const int mx = 1e5;
	vector<int> cnt(mx + 1);
	for(auto &[i, l, r]: q){
		cin >> i >> l >> r, -- i;
		++ cnt[l];
		-- cnt[r];
	}
	vector<double> value(mx + 1);
	for(auto t = 0; t < mx; ++ t){
		cnt[t + 1] += cnt[t];
		value[t + 1] = value[t] + (cnt[t] ? 1.0 / cnt[t] : 0);
	}
	vector<double> res(n);
	for(auto [i, l, r]: q){
		res[i] += value[r] - value[l];
	}
	ranges::copy(res, ostream_iterator<double>(cout, "\n"));
	return 0;
}

/*

*/

////////////////////////////////////////////////////////////////////////////////////////
//                                                                                    //
//                                   Coded by Aeren                                   //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////
0