結果

問題 No.2462 七人カノン
コンテスト
ユーザー detteiuu
提出日時 2024-12-22 03:26:19
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 186 ms / 2,000 ms
+ 981µs
コード長 493 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 208 ms
コンパイル使用メモリ 80,756 KB
実行使用メモリ 107,000 KB
最終ジャッジ日時 2026-10-05 20:17:57
合計ジャッジ時間 8,666 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N, Q = map(int, input().split())
query = [list(map(int, input().split())) for _ in range(Q)]

imos = [0]*(10**5+1)
for I, S, T in query:
    imos[S] += 1
    imos[T] -= 1
for i in range(1, 10**5+1):
    imos[i] += imos[i-1]

for i in range(10**5+1):
    if 1 <= imos[i]:
        imos[i] = 1/imos[i]

cum = [0]
for i in range(10**5+1):
    cum.append(cum[-1]+imos[i])

def cumQ(L, R):
    return cum[R]-cum[L]

ans = [0]*N
for I, S, T in query:
    ans[I-1] += cumQ(S, T)

print(*ans, sep="\n")
0