結果

問題 No.2462 七人カノン
ユーザー 👑 rin204rin204
提出日時 2023-09-18 16:06:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 336 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 100,812 KB
最終ジャッジ日時 2023-09-18 16:07:14
合計ジャッジ時間 11,406 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
83,104 KB
testcase_01 AC 85 ms
83,320 KB
testcase_02 AC 81 ms
83,112 KB
testcase_03 AC 100 ms
84,004 KB
testcase_04 AC 97 ms
84,020 KB
testcase_05 AC 96 ms
83,764 KB
testcase_06 AC 98 ms
83,712 KB
testcase_07 AC 97 ms
83,672 KB
testcase_08 AC 96 ms
83,728 KB
testcase_09 AC 95 ms
83,616 KB
testcase_10 AC 101 ms
83,832 KB
testcase_11 AC 104 ms
83,940 KB
testcase_12 AC 97 ms
83,656 KB
testcase_13 AC 312 ms
98,324 KB
testcase_14 AC 277 ms
99,124 KB
testcase_15 AC 269 ms
98,592 KB
testcase_16 AC 286 ms
100,444 KB
testcase_17 AC 294 ms
100,448 KB
testcase_18 AC 100 ms
87,872 KB
testcase_19 AC 100 ms
88,148 KB
testcase_20 AC 336 ms
100,368 KB
testcase_21 AC 311 ms
100,812 KB
testcase_22 AC 310 ms
100,244 KB
testcase_23 AC 313 ms
100,496 KB
testcase_24 AC 235 ms
95,360 KB
testcase_25 AC 331 ms
100,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, Q = map(int, input().split())
imos = [0] * 100001
ist = [list(map(int, input().split())) for _ in range(Q)]
for i, s, t in ist:
    imos[s] += 1
    imos[t] -= 1

for i in range(1, 100001):
    imos[i] += imos[i - 1]

tot = [0]
for i in imos:
    tot.append(tot[-1] + 1 / i if i else 0)

ans = [0] * n
for i, s, t in ist:
    ans[i - 1] += tot[t] - tot[s]

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