結果

問題 No.2462 七人カノン
ユーザー miho-4miho-4
提出日時 2023-09-08 22:08:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 324 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 877 ms
コンパイル使用メモリ 86,756 KB
実行使用メモリ 92,636 KB
最終ジャッジ日時 2023-09-08 22:08:53
合計ジャッジ時間 12,031 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
78,428 KB
testcase_01 AC 85 ms
78,484 KB
testcase_02 AC 83 ms
78,468 KB
testcase_03 AC 98 ms
79,036 KB
testcase_04 AC 95 ms
78,944 KB
testcase_05 AC 97 ms
79,064 KB
testcase_06 AC 98 ms
79,108 KB
testcase_07 AC 96 ms
79,016 KB
testcase_08 AC 95 ms
79,056 KB
testcase_09 AC 92 ms
78,988 KB
testcase_10 AC 99 ms
79,040 KB
testcase_11 AC 98 ms
78,876 KB
testcase_12 AC 95 ms
79,048 KB
testcase_13 AC 292 ms
90,356 KB
testcase_14 AC 280 ms
90,864 KB
testcase_15 AC 266 ms
90,376 KB
testcase_16 AC 290 ms
92,636 KB
testcase_17 AC 289 ms
92,348 KB
testcase_18 AC 108 ms
80,576 KB
testcase_19 AC 111 ms
80,748 KB
testcase_20 AC 324 ms
92,144 KB
testcase_21 AC 315 ms
92,184 KB
testcase_22 AC 315 ms
91,956 KB
testcase_23 AC 313 ms
91,748 KB
testcase_24 AC 233 ms
86,972 KB
testcase_25 AC 321 ms
91,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,q=map(int,input().split())
L=[list(map(int,input().split())) for _ in range(q)]

T=[0]*(10**5+2)
for i,s,t in L:
  T[s]+=1
  T[t]-=1
g=[0]*(10**5+3)  
for i in range(1,10**5+2):
  T[i]+=T[i-1]
  if 0<T[i]:
    g[i]=1/T[i]
if 0<T[0]:
  g[0]=1/T[0]

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

ans=[0]*n
for i,s,t in L:
  ans[i-1]+=g[t-1]-g[s-1]
  
for e in ans:
  print(e)
0