結果

問題 No.2462 七人カノン
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-09-08 22:41:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 319 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 459 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 92,420 KB
最終ジャッジ日時 2023-09-08 22:41:45
合計ジャッジ時間 11,342 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
78,468 KB
testcase_01 AC 81 ms
78,356 KB
testcase_02 AC 79 ms
78,500 KB
testcase_03 AC 96 ms
79,032 KB
testcase_04 AC 94 ms
79,244 KB
testcase_05 AC 95 ms
79,136 KB
testcase_06 AC 101 ms
78,968 KB
testcase_07 AC 92 ms
79,072 KB
testcase_08 AC 93 ms
78,900 KB
testcase_09 AC 93 ms
79,072 KB
testcase_10 AC 96 ms
79,140 KB
testcase_11 AC 97 ms
79,168 KB
testcase_12 AC 93 ms
78,912 KB
testcase_13 AC 264 ms
90,516 KB
testcase_14 AC 277 ms
90,776 KB
testcase_15 AC 267 ms
90,464 KB
testcase_16 AC 291 ms
92,420 KB
testcase_17 AC 285 ms
92,416 KB
testcase_18 AC 105 ms
80,776 KB
testcase_19 AC 110 ms
80,800 KB
testcase_20 AC 312 ms
92,304 KB
testcase_21 AC 307 ms
92,136 KB
testcase_22 AC 319 ms
92,012 KB
testcase_23 AC 307 ms
91,808 KB
testcase_24 AC 241 ms
86,820 KB
testcase_25 AC 311 ms
91,676 KB
権限があれば一括ダウンロードができます

ソースコード

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