結果

問題 No.2462 七人カノン
ユーザー hourenhouren
提出日時 2023-09-08 21:53:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 1,089 bytes
コンパイル時間 2,979 ms
コンパイル使用メモリ 168,184 KB
実行使用メモリ 7,912 KB
最終ジャッジ日時 2023-09-08 21:53:31
合計ジャッジ時間 10,287 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,840 KB
testcase_01 AC 4 ms
4,848 KB
testcase_02 AC 4 ms
5,336 KB
testcase_03 AC 5 ms
5,084 KB
testcase_04 AC 5 ms
5,084 KB
testcase_05 AC 5 ms
5,336 KB
testcase_06 AC 5 ms
5,080 KB
testcase_07 AC 5 ms
5,148 KB
testcase_08 AC 5 ms
5,112 KB
testcase_09 AC 4 ms
5,100 KB
testcase_10 AC 4 ms
5,152 KB
testcase_11 AC 5 ms
5,144 KB
testcase_12 AC 5 ms
5,144 KB
testcase_13 AC 73 ms
7,332 KB
testcase_14 AC 80 ms
7,520 KB
testcase_15 AC 74 ms
7,744 KB
testcase_16 AC 85 ms
7,748 KB
testcase_17 AC 85 ms
7,912 KB
testcase_18 AC 55 ms
6,428 KB
testcase_19 AC 56 ms
6,428 KB
testcase_20 AC 80 ms
7,876 KB
testcase_21 AC 80 ms
7,740 KB
testcase_22 AC 83 ms
7,728 KB
testcase_23 AC 79 ms
7,728 KB
testcase_24 AC 72 ms
7,484 KB
testcase_25 AC 86 ms
7,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
#define fix(x) fixed << setprecision(x)
#define asc(x) x, vector<x>, greater<x>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool chmax(T&a, const T&b){if(a<b){a=b;return 1;}return 0;}
constexpr ll INFLL = (1LL << 62), MOD = 998244353;
constexpr int INF = (1 << 30), M = 1e5+1;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,q;
    cin >> n >> q;
    vector<int> imos(M+1,0);
    vector<int> x(q), s(q), t(q);
    rep(i,q){
        cin >> x[i] >> s[i] >> t[i];
        s[i]++; t[i]++; x[i]--;
        imos[s[i]]++; imos[t[i]]--;
    }
    vector<ld> tot(M+1,1), ans(n,0);
    rep(i,M) imos[i+1] += imos[i];
    rep(i,M+1) if(imos[i]) tot[i] /= imos[i];
    rep(i,M) tot[i+1] += tot[i];
    rep(i,q) ans[x[i]] += tot[t[i]-1] - tot[s[i]-1];
    cout << fix(16);
    rep(i,n) cout << ans[i] << '\n';
    return 0;
}
0