結果
問題 | No.2462 七人カノン |
ユーザー |
|
提出日時 | 2023-09-08 21:31:21 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 82 ms / 2,000 ms |
コード長 | 1,168 bytes |
コンパイル時間 | 3,637 ms |
コンパイル使用メモリ | 366,124 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 14:21:26 |
合計ジャッジ時間 | 10,942 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
#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 // // // ////////////////////////////////////////////////////////////////////////////////////////