結果

問題 No.2462 七人カノン
ユーザー miya145592miya145592
提出日時 2023-09-08 22:21:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 326 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 103,500 KB
最終ジャッジ日時 2023-09-08 22:22:06
合計ジャッジ時間 11,796 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
89,648 KB
testcase_01 AC 91 ms
89,512 KB
testcase_02 AC 88 ms
89,472 KB
testcase_03 AC 106 ms
90,512 KB
testcase_04 AC 102 ms
90,420 KB
testcase_05 AC 103 ms
90,060 KB
testcase_06 AC 107 ms
89,880 KB
testcase_07 AC 101 ms
89,832 KB
testcase_08 AC 103 ms
90,148 KB
testcase_09 AC 104 ms
89,936 KB
testcase_10 AC 108 ms
89,996 KB
testcase_11 AC 106 ms
90,104 KB
testcase_12 AC 111 ms
90,028 KB
testcase_13 AC 272 ms
101,872 KB
testcase_14 AC 277 ms
96,720 KB
testcase_15 AC 275 ms
101,232 KB
testcase_16 AC 290 ms
103,500 KB
testcase_17 AC 295 ms
103,148 KB
testcase_18 AC 117 ms
91,700 KB
testcase_19 AC 113 ms
91,708 KB
testcase_20 AC 318 ms
102,956 KB
testcase_21 AC 316 ms
102,812 KB
testcase_22 AC 326 ms
102,716 KB
testcase_23 AC 319 ms
102,900 KB
testcase_24 AC 243 ms
97,640 KB
testcase_25 AC 325 ms
102,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, Q = map(int, input().split())
IST = [list(map(int, input().split())) for _ in range(Q)]
P = [0 for _ in range(10**5+1)]
for i, s, t in IST:
    P[s] += 1
    P[t] -= 1
S = [0]
for p in P:
    S.append(S[-1]+p)
M = [0]
for s in S:
    if s==0:
        M.append(M[-1])
    else:
        M.append(M[-1]+(1/s))
ans = [0 for _ in range(N)]
for i, s, t in IST:
    ans[i-1] += M[t+1]-M[s+1]
for a in ans:
    print(a)


0