結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
79,460 KB
testcase_01 AC 86 ms
79,544 KB
testcase_02 AC 80 ms
79,512 KB
testcase_03 AC 99 ms
79,748 KB
testcase_04 AC 95 ms
79,560 KB
testcase_05 AC 95 ms
79,556 KB
testcase_06 AC 95 ms
79,640 KB
testcase_07 AC 97 ms
79,672 KB
testcase_08 AC 95 ms
79,532 KB
testcase_09 AC 94 ms
79,560 KB
testcase_10 AC 99 ms
79,964 KB
testcase_11 AC 97 ms
79,556 KB
testcase_12 AC 93 ms
79,676 KB
testcase_13 AC 277 ms
96,788 KB
testcase_14 AC 278 ms
97,260 KB
testcase_15 AC 272 ms
96,396 KB
testcase_16 AC 291 ms
98,908 KB
testcase_17 AC 299 ms
98,792 KB
testcase_18 AC 104 ms
84,120 KB
testcase_19 AC 107 ms
84,172 KB
testcase_20 AC 303 ms
98,520 KB
testcase_21 AC 310 ms
98,488 KB
testcase_22 AC 305 ms
98,308 KB
testcase_23 AC 307 ms
98,308 KB
testcase_24 AC 236 ms
92,420 KB
testcase_25 AC 319 ms
99,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q=map(int,input().split())
ans=[0 for i in range(N)]
canon=[]
time=[0 for i in range(200000)]
for i in range(Q):
    I,S,T=map(int,input().split())
    time[S+1]+=1
    time[T+1]-=1
    canon.append((I,S,T))
for i in range(150000):
    time[i+1]+=time[i]
for i in range(150000):
    if time[i]>0:
        time[i]=1/time[i]
for i in range(150000):
    time[i+1]+=time[i]
for i,s,t in canon:
    ans[i-1]+=time[t]-time[s]
print(*ans,sep="\n")
0