結果

問題 No.2462 七人カノン
ユーザー mymelochanmymelochan
提出日時 2023-09-08 21:44:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 309 ms / 2,000 ms
コード長 888 bytes
コンパイル時間 1,450 ms
コンパイル使用メモリ 86,536 KB
実行使用メモリ 97,400 KB
最終ジャッジ日時 2023-09-08 21:44:59
合計ジャッジ時間 11,402 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
84,232 KB
testcase_01 AC 114 ms
84,392 KB
testcase_02 AC 108 ms
84,056 KB
testcase_03 AC 124 ms
84,916 KB
testcase_04 AC 119 ms
84,796 KB
testcase_05 AC 119 ms
84,812 KB
testcase_06 AC 120 ms
84,452 KB
testcase_07 AC 126 ms
84,536 KB
testcase_08 AC 125 ms
84,596 KB
testcase_09 AC 123 ms
84,520 KB
testcase_10 AC 125 ms
84,728 KB
testcase_11 AC 122 ms
84,896 KB
testcase_12 AC 117 ms
84,520 KB
testcase_13 AC 261 ms
95,900 KB
testcase_14 AC 271 ms
96,740 KB
testcase_15 AC 255 ms
95,508 KB
testcase_16 AC 276 ms
97,272 KB
testcase_17 AC 276 ms
97,208 KB
testcase_18 AC 134 ms
87,000 KB
testcase_19 AC 131 ms
86,356 KB
testcase_20 AC 296 ms
97,284 KB
testcase_21 AC 300 ms
97,088 KB
testcase_22 AC 298 ms
97,400 KB
testcase_23 AC 309 ms
97,208 KB
testcase_24 AC 238 ms
92,028 KB
testcase_25 AC 297 ms
97,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#############################################################

import sys
sys.setrecursionlimit(10**7)

from heapq import heappop,heappush
from collections import deque,defaultdict,Counter
from bisect import bisect_left, bisect_right
from itertools import product,combinations,permutations

ipt = sys.stdin.readline

def iin():
    return int(ipt())
def lmin():
    return list(map(int,ipt().split()))

MOD = 998244353
#############################################################

N,Q = lmin()
L = [lmin() for _ in range(Q)]

S = [0]*(10**5+10)
for _,s,t in L:
    S[s+1] += 1
    S[t+1] += -1

for i in range(1,10**5+1):
    S[i] += S[i-1]



T = []
for s in S:
    if s:
        T.append(1/s)
    else:
        T.append(0)

for i in range(1,10**5+1):
    T[i] += T[i-1]

#print(S[:20])
#print(T[:20])

ans = [0]*N
for i,s,t in L:
    ans[i-1] += T[t]-T[s]

for a in ans:
    print(a)

0