結果

問題 No.2462 七人カノン
ユーザー aaaaaaaaaa2230
提出日時 2023-09-08 22:41:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 289 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,208 KB
実行使用メモリ 91,492 KB
最終ジャッジ日時 2024-06-26 15:54:27
合計ジャッジ時間 9,830 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

n,q = map(int,input().split())

M = 10**5+5

imos = [0]*M

IST = [list(map(int,input().split())) for i in range(q)]

ans = [0]*n

for i,s,t in IST:
    imos[s] += 1
    imos[t] -= 1

score = [0]*M
for i in range(M-1):
    imos[i+1] += imos[i]
for i in range(M):
    if imos[i]:
        score[i] = 1/imos[i]
    score[i] += score[i-1]
for i,s,t in IST:
    i -= 1
    ans[i] += score[t-1]
    if s:
        ans[i] -= score[s-1]

for i in ans:
    print(i)
0