結果

問題 No.2462 七人カノン
ユーザー ShirotsumeShirotsume
提出日時 2023-09-08 21:41:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 397 ms / 2,000 ms
コード長 698 bytes
コンパイル時間 528 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 99,604 KB
最終ジャッジ日時 2023-09-08 21:41:46
合計ジャッジ時間 13,109 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 149 ms
80,500 KB
testcase_01 AC 125 ms
80,568 KB
testcase_02 AC 122 ms
80,580 KB
testcase_03 AC 148 ms
88,072 KB
testcase_04 AC 149 ms
87,928 KB
testcase_05 AC 148 ms
88,284 KB
testcase_06 AC 151 ms
87,964 KB
testcase_07 AC 156 ms
87,868 KB
testcase_08 AC 149 ms
88,080 KB
testcase_09 AC 148 ms
87,676 KB
testcase_10 AC 149 ms
88,124 KB
testcase_11 AC 150 ms
87,840 KB
testcase_12 AC 148 ms
87,744 KB
testcase_13 AC 372 ms
97,804 KB
testcase_14 AC 376 ms
97,776 KB
testcase_15 AC 351 ms
97,576 KB
testcase_16 AC 385 ms
99,512 KB
testcase_17 AC 397 ms
99,604 KB
testcase_18 AC 164 ms
89,928 KB
testcase_19 AC 169 ms
89,700 KB
testcase_20 AC 300 ms
93,260 KB
testcase_21 AC 303 ms
93,156 KB
testcase_22 AC 303 ms
93,416 KB
testcase_23 AC 306 ms
93,664 KB
testcase_24 AC 293 ms
96,556 KB
testcase_25 AC 377 ms
96,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

n, q = mi()

start = [[] for _ in range(10 ** 5 + 1)]
end = [[] for _ in range(10 ** 5 + 1)]
for _ in range(q):
    i, s, t = mi()
    i -= 1
    start[s].append(i)
    end[t].append(i)

ans = [0] * n

counter = 0
now = 0
for t in range(10 ** 5 + 1):
    for v in start[t]:
        ans[v] -= counter
        now += 1
    for v in end[t]:
        ans[v] += counter
        now -= 1
    if now > 0:
        counter += 1 / now

for v in ans:
    print(v)
0